stylish)
!important
!important
!important
(rare)color
inherit by default, others like display
do notinherit
: to use DOM parent's valueinitial
: according to CSS specificationsunset
: equivalent to inherit
if normally inherited, initial
if normally not.as-child { /* eg: position: absolute; */ }
.as-self { /* eg: color: tomato; */ }
.as-parent { /* eg: display: flex; */ }
.as-peer { /* eg: margin: 1em; */ }
<div class="as-child as-self as-parent as-peer">
content
</div>
.foo { /* eg: display: flex; */ }
.foo > * { /* eg: flex: 1 0 50%; */ }
<div class="foo">
<div>content</div>
<div>content</div>
<div>content</div>
</div>
div > p {
font-style : italic;
font-family : serif;
background : blue;
color : tomato
}
<div>
<p>
italic, serif, blue background, tomato text
</p>
</div>
.Fs(i) { font-style : italic; }
.Ff(serif) { font-family : serif; }
.Bg(blue) { background : blue; }
.C(tomato) { color : tomato }
<div>
<p class="Fs(i) Ff(serif) Bg(blue) C(tomato)">
italic, serif, blue background, tomato text
</p>
</div>
.foo {
color: var(--foo-color, tomato);
}
.foo--modified {
--foo-color: firebrick;
}
#foo-target {
--foo-color: orchid;
}
<p class="foo">
tomato text (fallback to default)
</p>
<p class="foo foo--modified">
firebrick text, specificity 10
</p>
<p class="foo" id="foo-target">
orchid text, specificity 100
</p>
<p class="foo" style="--foo-color: seagreen;">
seagreen text, specificity 1000
</p>
unset
in unsupported browsers.foo {
--foo-background: linear-gradient(
var(--foo-angle),
seagreen,
tomato
);
background: var(--foo-background);
}
<p class="foo">no background (no default, "unset")</p>
<p class="foo" style="--foo-angle: 10deg">dynamic</p>
<p class="foo" style="--foo-angle: 20deg">dynamic</p>
<p class="foo" style="--foo-angle: 30deg">dynamic</p>