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

Normalize button moz-focus-inner #2445

Merged
merged 9 commits into from
Oct 24, 2019
Merged

Conversation

andreadelrio
Copy link
Contributor

Summary

Remove border that shows up when tabbing through components in Firefox. Covers #2373

Checklist

- [ ] Checked in dark mode
- [ ] Checked in mobile

  • Checked in IE11 and Firefox
    - [ ] Props have proper autodocs
    - [ ] Added documentation examples
    - [ ] Added or updated jest tests
    - [ ] Checked for breaking changes and labeled appropriately
    - [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

CHANGELOG.md Outdated
@@ -1,6 +1,8 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added ability for `EuiColorStops` to accept user-defined range bounds ([#2396](https://github.com/elastic/eui/pull/2396))
- Added ability for `EuiColorStops` to accept user-defined range bounds ([#2396](https://github.com/elastic/eui/pull/2396))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think you got an extra CL in here

@myasonik
Copy link
Contributor

I setup a reduced test case because I'm not sure what other styles are having an effect inside EUI but ::-moz-focus-inner does not seem to be the selector we want.

Seems like ::moz-focusring works:
https://codepen.io/myasonik/pen/QWLPKjQ?editors=1100

@cchaos
Copy link
Contributor

cchaos commented Oct 17, 2019

I don't think it hurts to have both. Normalize uses both. https://github.com/necolas/normalize.css/blob/fc091cce1534909334c1911709a39c22d406977b/normalize.css#L202-L223

But in @myasonik's codepen, the -moz-focusring also changes the border which completely removes the actual button border which seems to have unintended consequences.

@andreadelrio
Copy link
Contributor Author

Not sure what's happening on that codepen but I've tested with ::-moz-focus-inner and it works well in Eui (tabs, buttons). -moz-focusring alone doesn't seem to be removing the dotted border in Eui. I suggest we stick with just ::-moz-focus-inner because Mozilla advices not to use -moz-focusring in production sites:

This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. from https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-focusring

@cchaos
Copy link
Contributor

cchaos commented Oct 22, 2019

Well it seems there are inconsistencies between browser versions for support. Perhaps it is just best to support both.

@andreadelrio
Copy link
Contributor Author

Well it seems there are inconsistencies between browser versions for support. Perhaps it is just best to support both.

I've added -moz-focusring to be on the safer side. From what I can tell we only need outline: none; there as border: none; (present on @myasonik's CodePen) has unintended effects on the elements (for example, borders getting removed from EuiButton on focus). So I've done:

  &:-moz-focusring {
    outline: none;
  }

@andreadelrio andreadelrio requested a review from cchaos October 23, 2019 22:14
Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and there doesn't seem to be any adverse affects.

I think you just need to rebase with master to put the CL item in the right place and then you're good to merge.

@andreadelrio andreadelrio merged commit a482a86 into elastic:master Oct 24, 2019
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

Successfully merging this pull request may close these issues.

4 participants