Skip to content

Instantly share code, notes, and snippets.

Created September 8, 2016 21:20
Show Gist options
  • Save anonymous/95e7ae1bf332a27f1d59f9cb4711c6d6 to your computer and use it in GitHub Desktop.
Save anonymous/95e7ae1bf332a27f1d59f9cb4711c6d6 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