Skip to content

Instantly share code, notes, and snippets.

@kizu
Created October 26, 2016 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kizu/3208e66dba09d46283b60fa92b9e16be to your computer and use it in GitHub Desktop.
Save kizu/3208e66dba09d46283b60fa92b9e16be to your computer and use it in GitHub Desktop.
Oh hai, Selectors level 4!
/* 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
}
<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>
// alert('Hello world!');
{"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