Skip to content
This repository was archived by the owner on Dec 11, 2021. It is now read-only.

Commit ab4bfa8

Browse files
cvrebertsfrisk
authored andcommitted
Hidden Attribute: Enforce display none
Closes gh-109
1 parent b493935 commit ab4bfa8

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

.csslintrc

+2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@
88
"important": false,
99
"outline-none": false,
1010
"overqualified-elements": false,
11+
"unique-headings": false,
12+
"unqualified-attributes": false,
1113
"text-indent": false
1214
}

scss/_utilities/_hidden.scss

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* ==========================================================================
3+
* Hidden attribute
4+
*
5+
* Make the [hidden] global HTML attribute much more useful.
6+
* It's intended to be used to hide elements, but since it's not `!important`
7+
* by default, it's normally trumped by mere CSS classes that were only meant
8+
* to set a default `display` value. Making it `!important` (which is fine
9+
* because this is a utility attribute) corrects this shortcoming.
10+
* https://html.spec.whatwg.org/multipage/interaction.html#the-hidden-attribute
11+
* https://html.spec.whatwg.org/multipage/rendering.html#hiddenCSS
12+
* ==========================================================================
13+
*/
14+
15+
[hidden] {
16+
display: none !important;
17+
}

scss/lint.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
@import
1313
"_utilities/clearfix",
14-
"_utilities/colors";
14+
"_utilities/colors",
15+
"_utilities/hidden";
1516

1617
@import
1718
"atoms/icons/icons",

scss/style.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
// ==========================================================================
44

55
@import
6-
"_utilities/clearfix";
6+
"_utilities/clearfix",
7+
"_utilities/hidden";
78

89
@import
910
"atoms/icons/icons",

tasks/options/csslint.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
module.exports = {
2-
src: [ "dist/css/*.css" ]
2+
src: [ "dist/css/*.css" ],
3+
options: {
4+
csslintrc: ".csslintrc"
5+
}
36
};

0 commit comments

Comments
 (0)