
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@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 346 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.