Skip to content

Commit f3165c6

Browse files
committed
Adds a note on docs about reduced motion.
1 parent 7478979 commit f3165c6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A custom element that shows text as if it were being typed
55
## Installation
66

77
```
8-
$ npm install @github/typing-effect-element
8+
npm install @github/typing-effect-element
99
```
1010

1111
## Usage
@@ -21,6 +21,16 @@ import '@github/typing-effect-element'
2121
</typing-effect>
2222
```
2323

24+
## Accessibility
25+
26+
This component detects whether `prefers-reduced-motion` is set on the window
27+
28+
```js
29+
window.matchMedia('(prefers-reduced-motion)').matches === true
30+
```
31+
32+
If this evaluates to true, any content lines provided will be appended immediately rather than being typed out with a delay.
33+
2434
## Browser support
2535

2636
Browsers without native [custom element support][support] require a [polyfill][].

0 commit comments

Comments
 (0)