Created
October 26, 2016 12:55
-
-
Save kizu/b348fc334c2e386e81e6592cb89ca033 to your computer and use it in GitHub Desktop.
Oh hai, Selectors level 4!
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
/* Oh hai, Selectors level 4! */ | |
/* https://drafts.csswg.org/selectors-4/ */ | |
/* Try this at http://nightly.webkit.org/ */ | |
div:before { | |
content: attr(class); | |
} | |
.a.b:not(.c) { | |
background: red; | |
border-left: 10px solid; | |
} | |
/* Multiclass with the same specificity as just one class! */ | |
:not(:not(.a), :not(.b), :not(.c)) { | |
background: blue; /* Is overridden later with lime */ | |
border-left: 20px solid; /* Is applied anyway */ | |
} | |
.a { | |
background: lime | |
} |
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 class="a"></div> | |
<div class="a"></div> | |
<div class="a"></div> | |
<div class="a b"></div> | |
<div class="a b"></div> | |
<div class="a b"></div> | |
<div class="a b c"></div> | |
<div class="a b c" id="lol"></div> |
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
// alert('Hello world!'); |
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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment