Skip to content

Commit 3941f89

Browse files
authored
Add not-visuallyhidden class
This allows for toggling whether an element is hidden or not responsively (e.g. should be hidden on mobile but visible on medium screens and upwards).
1 parent 39c8925 commit 3941f89

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ module.exports = function (variants) {
33
const className = 'visuallyhidden';
44
const focusClassName = 'focusable';
55

6+
const original = {
7+
clip: 'auto',
8+
clipPath: 'none',
9+
height: 'auto',
10+
margin: 'auto',
11+
overflow: 'auto',
12+
position: 'relative',
13+
width: 'auto',
14+
whiteSpace: 'normal',
15+
}
16+
617
const focusable = {
718
clip: 'auto',
819
clipPath: 'none',
@@ -28,6 +39,8 @@ module.exports = function (variants) {
2839
whiteSpace: 'nowrap', /* 1 */
2940
},
3041

42+
[`.not-${className}`]: original,
43+
3144
[`.${className}.${focusClassName}:active`]: focusable,
3245
[`.${className}.${focusClassName}:focus`]: focusable,
3346

0 commit comments

Comments
 (0)