Skip to content

Commit

Permalink
Update README with workaround for class stomping (#180)
Browse files Browse the repository at this point in the history
Include mention of using the [data-focus-visible-added] attribute to work around frameworks that stomp on the polyfill class. Fixes #179.
  • Loading branch information
robdodson committed Sep 22, 2018
1 parent 366db2b commit c16758a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -62,6 +62,14 @@ If there are elements which should always have a focus ring shown,
authors may explicitly add the `focus-visible` class.
If explicitly added, it will not be removed on `blur`.

Alternatively, if you're using a framework which overwrites your classes ([#179](https://github.com/WICG/focus-visible/issues/179)),
you can rely on the `data-focus-visible-added` attribute.
```css
.js-focus-visible :focus:not([data-focus-visible-added]) {
outline: none;
}
```

### How it works

The script uses two heuristics to determine whether the keyboard is being used:
Expand Down

0 comments on commit c16758a

Please sign in to comment.