Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryanve/focux
Match :focus-within for better focus experience
https://github.com/ryanve/focux
focus focus-within javascript opensource
Last synced: about 1 month ago
JSON representation
Match :focus-within for better focus experience
- Host: GitHub
- URL: https://github.com/ryanve/focux
- Owner: ryanve
- License: other
- Created: 2018-01-14T06:19:03.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-15T04:29:54.000Z (almost 7 years ago)
- Last Synced: 2024-08-09T03:54:22.353Z (3 months ago)
- Topics: focus, focus-within, javascript, opensource
- Language: HTML
- Homepage: https://ryanve.github.io/focux
- Size: 45.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# [`focux`](https://www.npmjs.com/package/focux)
detect [`:focus-within`](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-within) for better UX```
npm install focux
``````js
const focux = require("focux")
```## api
### `focux.within(element)`
- test if `element` matches `:focus-within` specification
- matches even without native `:focus-within` support
- `element` is a DOM element node
- `@return boolean````js
focux.within(element) // true || false
```## compatibility
- [ES5+](https://caniuse.com/#feat=es5)