Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Chrome showing black border on focus state for button user agent styles

Recently i was working on a web design project, and noticed something odd, after the last Google Chrome update. The default border style(user agent style) for button is changed, and which is looking visually annoying to me.

Is there any method to modify/restore the default browser styles, i.e., user agent styles permanently?

here are some images of the problem: self developed web page button

state of border color on click/focus

i have also checked other websites and even google browsing on google images

other example

also checked the dev tool, found this border styles applied on the focus state of the button also checked the dev tool, found this border styles applied on the focus state of the button

like image 496
Diwakar Avatar asked May 24 '20 20:05

Diwakar


People also ask

How do you put a border on Google Chrome?

Find the new Chrome border width and Chrome border color under Settings -> Themes -> pick a theme -> Chrome in the accordion menu. “Chrome” is what we call the bubble around the Userflow content. The tooltip notch (the little arrow) will automatically reflect your border color.


2 Answers

This is because the new chrome update https://developers.google.com/web/updates/2020/05/nic83#forms

you can override black outline in most cases by

*,*:focus,*:hover{     outline:none; } 

and you can see this article

https://web.dev/style-focus/#use-:focus-visible-to-selectively-show-a-focus-indicator

if you want to remove outline just for mouse user.

like image 61
mohade Avatar answered Sep 20 '22 16:09

mohade


You could try disabling this flag: chrome://flags/#form-controls-refresh 

Apparently the 83+ version of chrome changed how forms are rendered / handled: https://blog.chromium.org/2020/03/updates-to-form-controls-and-focus.html

Here is a relevent Google Support page which links to the blog post above: https://support.google.com/chrome/thread/48974735?hl=en

like image 41
Gagan Deep Avatar answered Sep 18 '22 16:09

Gagan Deep