Skip to content

Instantly share code, notes, and snippets.

@svgeesus
Forked from anonymous/dabblet.css
Created September 8, 2016 22:05
Show Gist options
  • Save svgeesus/63385c5b47840b175c54f8e60e3d569b to your computer and use it in GitHub Desktop.
Save svgeesus/63385c5b47840b175c54f8e60e3d569b to your computer and use it in GitHub Desktop.
Test inherited value of currentColor is the keyword currentColor
/* Test inherited value of currentColor is the keyword currentColor
"This happens at used-value time, which means that if the value is inherited, it’s
inherited as currentcolor, not as the value of the color property, so descendants
will use their own color property to resolve it."
*/
.outer {color: red;
background-color: currentColor;
font-size: 200%;
width: 6em;
height: 6em; }
.middle {background-color: inherit;
width: 6em;
height: 6em;}
.inner {color: green;
background-color: inherit;
width: 6em;
height: 6em;
font-weight: bold;}
<body> <p>Test passes if you see a green square, and no red.</p>
<div class="outer"><div class="middle"><div class="inner">FAIL</div></div></div>
</body>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment