1.0.8 • Published 7 years ago

mouse-focused v1.0.8

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

#mouse-focused

This script adds specific class ('is-mouse-focused') to DOM-elements which was focused by mouse.

It is common for developers to add css which hides focused element's outline to make html page look prettier. However it makes content unaccessible (see WAI-ARIA Practices). This script allows to separate focusing from keyboard and mouse. After including it you can use the following code:

.is-mouse-focused {
 outline: none;
}

This css removes default outline from mouse focused elements. But for users, which use keyboard to navigate, experience will not changed.

NPM

Installation

Component can be installed with npm:

npm install mouse-focused

Usage

Using require

require('mouse-focused');

or simply add script to html

<script type="text/javascript" src="mouse-focused.js"></script>
1.0.8

7 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago