Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@notainc/key-focus-visible
Advanced tools
This library allows you to show CSS :focus pseudo-class only when triggered by the keyboard.
This library allows you to show CSS :focus
pseudo-class only when triggered by the keyboard.
Alternatively, :focus-visible
polyfill is available.
Here are advantages compared to the polifill:
Detailed behavior:
In both cases, we remember the last used input device to focus, and if it was a keyboard, focus is shown, if it was a pointing device, focus is not shown.
$ npm install @notainc/key-focus-visible
Just import/require this library to your project.
import '@notainc/key-focus-visible'
It sets data-focus-visible
attribute on body
element when the focus is given by the keyboard.
So you can apply the style as follows:
*:focus {
outline: none;
}
[data-focus-visible] *:focus {
box-shadow: 0 0 0px 4px rgba(64, 167, 255, 0.6);
}
You can also use it in Sass:
.foo-component {
background-color: #fff;
&:active,
&:hover,
[data-focus-visible] &:focus {
background-color: #ccc;
}
}
See the live demo here
Suports ordinary modern dekstop browsers (Chrome, Firefox, Safari, Opera, Edge) and mobile browsers (Chrome for Android, iOS Safari)
Does not throw error on IE.
This software is released under the MIT License, see LICENSE.
FAQs
This library allows you to show CSS :focus pseudo-class only when triggered by the keyboard.
The npm package @notainc/key-focus-visible receives a total of 694 weekly downloads. As such, @notainc/key-focus-visible popularity was classified as not popular.
We found that @notainc/key-focus-visible demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.