Gathering detailed insights and metrics for @notainc/key-focus-visible
Gathering detailed insights and metrics for @notainc/key-focus-visible
Gathering detailed insights and metrics for @notainc/key-focus-visible
Gathering detailed insights and metrics for @notainc/key-focus-visible
npm install @notainc/key-focus-visible
Typescript
Module System
Node Version
NPM Version
68.2
Supply Chain
87
Quality
82
Maintenance
100
Vulnerability
100
License
HTML (39.34%)
JavaScript (37.48%)
CSS (23.18%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
4 Stars
28 Commits
17 Watchers
8 Branches
35 Contributors
Updated on Jan 15, 2020
Latest Version
0.0.7
Package Id
@notainc/key-focus-visible@0.0.7
Unpacked Size
5.47 kB
Size
2.71 kB
File Count
4
NPM Version
6.7.0
Node Version
11.13.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
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.
1import '@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:
1*:focus { 2 outline: none; 3} 4 5[data-focus-visible] *:focus { 6 box-shadow: 0 0 0px 4px rgba(64, 167, 255, 0.6); 7}
You can also use it in Sass:
1.foo-component { 2 background-color: #fff; 3 4 &:active, 5 &:hover, 6 [data-focus-visible] &:focus { 7 background-color: #ccc; 8 } 9}
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.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/19 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
15 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More