Last active
June 27, 2021 18:37
-
-
Save viclafouch/157c2572d8235f4ebd1305b69b82f964 to your computer and use it in GitHub Desktop.
Lint CSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Prevent unsecure [target="_blank] links */ | |
a[target='_blank']:not([rel~='noopener']):not([rel~='noreferrer']) { | |
outline: 2px dashed red; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Input or label without id or for attribute */ | |
input:not([id]), | |
label:not([for]) { | |
outline: 2px dashed red; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Headers out of order */ | |
:is(h2, h3, h4, h5, h6) ~ h1, | |
:is(h3, h4, h5, h6) ~ h2, | |
:is(h4, h5, h6) ~ h3, | |
:is(h5, h6) ~ h4, | |
h6 ~ h5 { | |
outline: 2px dashed red; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Images without alt attribute */ | |
img:not([alt]) { | |
outline: 2px dashed red; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Div inside inline elements */ | |
:is(b, i, q, em, abbr, cite, code, span, small, label, strong) > div { | |
outline: 2px dashed red; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Lang attribute in html document */ | |
html:not([lang]):before { | |
display: block; | |
content: "You didn't declare lang attribute"; | |
color: red; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* <picture> elements that do not contain .webp <source> */ | |
picture > source:first-child:not([type="image/webp"])::before { | |
content: "Missing a webp source"; | |
padding: 1em; | |
display: block; | |
outline: 2px solid aqua; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment