Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么搜索的输入框focus的时候outline是黄色的 #4

Closed
cyhwinner opened this issue May 19, 2019 · 10 comments
Closed

为什么搜索的输入框focus的时候outline是黄色的 #4

cyhwinner opened this issue May 19, 2019 · 10 comments

Comments

@cyhwinner
Copy link

为什么搜索的输入框focus的时候outline是黄色的,可是我本地默认的是蓝色的,我也搜索了全局也没发现哪里有变动了outline

@BUPTlhuanyu
Copy link
Owner

您好,这是chrome默认的边框聚焦时候的outline,可以在reset.scss找那个加入如下代码进行自定义:
input:focus{outline:#CBE1EF solid thin;}

@cyhwinner
Copy link
Author

可是我搜索你的所有文件没发现有把outline设置成别的颜色的,只要发现的node_modules这个文件夹里面有几个包是有修改的

@BUPTlhuanyu
Copy link
Owner

黄色高亮是chrome默认的给的

@cyhwinner
Copy link
Author

cyhwinner commented May 25, 2019 via email

@BUPTlhuanyu
Copy link
Owner

这个,我再查查原因吧。可能是其他什么库重新设置了。

@BUPTlhuanyu
Copy link
Owner

BUPTlhuanyu commented Jun 4, 2019

不好意思,最近忙着毕业,今天找了一下原因,你可以先在你本地跑起项目,然后在chrome调试面板找到你的输入框的节点,右键改变输入框的状态,选择force-state,然后选择:focus ,可以看到你的输入框input就处于聚焦状态,并且能看到输入框的高亮的颜色。在style面板找到:focus的颜色样式为:

:focus {
    outline: -webkit-focus-ring-color auto 5px;
}

这个样式是浏览器的默认样式即user agent stylesheet。

chrome下的-webkit-focus-ring-color这个颜色就是金色: rgba(229, 151, 0, 255)
但是mac会覆盖的chrome的这个默认颜色:呈现为蓝色#7DADD9.

具体的可以参看:https://stackoverflow.com/questions/7538771/what-is-webkit-focus-ring-color

@cyhwinner
Copy link
Author

但是按照mac电脑覆盖来说 我在查询页focus的时候应该还是蓝色的啊

@BUPTlhuanyu
Copy link
Owner

能否贴一下你的图,看看你搜索框元素focus时候的样式,或者邮件我 [email protected]

@BUPTlhuanyu
Copy link
Owner

chrome浏览器下,outline不同的调试模式会有不同的默认样式,手机模式下为金色,pc为蓝色。

@BUPTlhuanyu BUPTlhuanyu pinned this issue Jun 7, 2019
@cyhwinner
Copy link
Author

多谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants