Skip to content

Instantly share code, notes, and snippets.

@Jagathishrex
Last active August 8, 2019 16:07
Show Gist options
  • Save Jagathishrex/d911a701e8662efe3c0f42598052094d to your computer and use it in GitHub Desktop.
Save Jagathishrex/d911a701e8662efe3c0f42598052094d to your computer and use it in GitHub Desktop.
<style>
.two {
--textcolor: red;
}
.three {
--textcolor: blue;
}
.two {
color : var(--textcolor);
}
.three {
color : var(--textcolor);
}
</style>
<div class="one">
<div class="two">
this is red
<div class="three">this is blue</div>
<div class="four"> this is red color , the color is inherited from parent</div>
</div>
</div>
<div class="red-container">
<span> hello(green) </span>
<span > 👋 </span>
<span> Javascript Jeep </span>
I am red
</div>
// css
<style >
div {
--txtColor : red;
}
span {
--txtColor : blue;
}
div {
color : var(--txtColor)
}
span {
color : var(--txtColor)
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment