Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

focus-visible

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

focus-visible

Polyfill for :focus-visible pseudo-selector

  • 5.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
279K
decreased by-51.53%
Maintainers
2
Weekly downloads
 
Created

What is focus-visible?

The focus-visible npm package is a polyfill for the CSS :focus-visible pseudo-class. It helps developers manage focus styles in a way that only applies them when the user is using a keyboard to navigate, avoiding unwanted focus styles when using a mouse or touch input.

What are focus-visible's main functionalities?

Polyfill for :focus-visible

This line of code imports the focus-visible polyfill, which automatically adds the necessary JavaScript to support the :focus-visible pseudo-class in browsers that do not natively support it.

import 'focus-visible';

Customizing focus styles

This CSS rule ensures that focus styles are only applied when the element has the .focus-visible class, which is added by the polyfill when the user is navigating with a keyboard.

.js-focus-visible :focus:not(.focus-visible) { outline: none; }

Other packages similar to focus-visible

FAQs

Package last updated on 12 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc