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

Outdated :-moz-focusring makes form elements less accessible #55

Open
LeoniePhiline opened this issue Jun 23, 2021 · 4 comments
Open

Outdated :-moz-focusring makes form elements less accessible #55

LeoniePhiline opened this issue Jun 23, 2021 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@LeoniePhiline
Copy link

LeoniePhiline commented Jun 23, 2021

The package applies an outdated inaccessible focus ring to form elements in firefox:

/**
Restore the focus styles unset by the previous rule.
*/

:-moz-focusring {
	outline: 1px dotted ButtonText;
}

This thin dotted gray line is inaccessible, outdated. Browsers have updated their default focus styles to be much more accessible, including Firefox.

Here an unstyled, focused textarea (without modern-normalize):

image

https://codepen.io/rickymetz/pen/ZrbXqJ

It would be fantastic if modern-normalize could undo the custom application of an inaccessible legacy Firefox focus style.

@sindresorhus
Copy link
Owner

Are you sure

/**
Remove the inner border and padding in Firefox.
*/
::-moz-focus-inner {
border-style: none;
padding: 0;
}
can be safely removed without introducing any regressions?

@LeoniePhiline
Copy link
Author

LeoniePhiline commented Jun 23, 2021

Hi, thanks for your response!

I believe this can be removed.

If you use a current version of Firefox (89.0.1) to view the two-buttons example at https://developer.mozilla.org/en-US/docs/Web/CSS/::-moz-focus-inner you will see that the example it does not work any more.

The ::-moz-focus-inner styles apparently have no influence on Firefox's "new style" focus ring, as far as I can see.

The example should show a padding and a dotted red border, but none of that is visible in Firefox 89.

PS: This commit is probably relevant: mozilla/gecko-dev@217ddbe#diff-92f5675383d4b1d6c842a89578aa87cd5bbdc01ce60603032ba3e63a0cef7bd4 (Confusingly, in this commit, and in the forms.css file at HEAD, you still see a lot of outline: 1px dotted - but Firefox definitely renders a more accessible focus ring by default now (as seen in the OP above).

I am not super deep in the subject, but the change seems to come together with moving towards :focus-visible (https://drafts.csswg.org/selectors/#the-focus-visible-pseudo)

PS 2: Also relevant:

@LeoniePhiline
Copy link
Author

LeoniePhiline commented Jun 23, 2021

Update:
The related tailwindcss bug tailwindlabs/tailwindcss#4769 has been fixed 🎉 (PR: tailwindlabs/tailwindcss#4780)

Findings which might be just as relevant here in modern-normalize: tailwindlabs/tailwindcss#4724

@LeoniePhiline
Copy link
Author

This might be something for modern-normalize to add a workaround for: tailwindlabs/tailwindcss#4769 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants