Polyfill for :focus-visible pseudo-selector
npm install @userlike/focus-visible
Based on the proposed CSS:focus-visible
pseudo-selector,
this prototype adds a focus-visible class to the focused element,
in situations in which the :focus-visible pseudo-selector should match.
- Read the Explainer.
- Read the Spec.
- Try the Demo.
- Give feedback!
- Open discussions:
- What's the impact on users with low vision or cognitive impairments?
- Should :focus-visible match when returning focus or programmatically focusing?
- Brainstorm: options for opting in to always matching focus ring.
npm install --save focus-visible
_We recommend only using versions of the polyfill that have been published to npm, rather than
cloning the repo and using the source directly. This helps ensure the version you're using is stable
and thoroughly tested._
_If you do want to build from source, make sure you clone the latest tag!_
``html
...