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

Add body class when loaded - fix #8 #50

Merged
merged 1 commit into from
Aug 10, 2017
Merged

Add body class when loaded - fix #8 #50

merged 1 commit into from
Aug 10, 2017

Conversation

stefanjudis
Copy link
Contributor

@stefanjudis stefanjudis commented Aug 10, 2017

I was just about to implement the polyfill and came across #8. It addresses my concerns completely because the CSS I have in my project is as follows. 👇

  :focus {
    outline-style: dashed;

    &:not(.focus-ring) {
      outline: none;
    }
  }

This can destroy the complete focus handling in case of JS failure or loading troubles.

This PR adds the discussed behavior of the polyfill to add a focus-ring-enabled class to the body element when it's done doing its magic. ;)

@stefanjudis
Copy link
Contributor Author

Marked as non substantive for IPR from ash-nazg.

* When the window regains focus, restore the focus-ring class to the element
* to which it was previously applied.
* When switching windows, keep track of the focused element if it has a
* focus-ring class.
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These JSDOC changes are not intended by me. It seems like the docs in the dist file were not up to date. Now they're matching with the docs in src.

@robdodson
Copy link
Collaborator

LGTM thank you @stefanjudis!

@robdodson robdodson merged commit 10c2e7f into WICG:master Aug 10, 2017
@stefanjudis stefanjudis deleted the add-body-class branch August 10, 2017 17:10
@stefanjudis
Copy link
Contributor Author

Thanks so much for merging.

Do you plan to also release a new version? 😊

@robdodson
Copy link
Collaborator

Yep I just want to check in with @alice first

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.

2 participants