If I use hex color it work's perfectly. Don't know why custom property doesn't working.
I tried everything, but no luck :( {I am using chrome}
:root {
--primary-color: hsl(0, 0% 20%);
}
.btn {
display: inline-block;
padding: 0.7rem 1.2rem;
/* border: none; */
background-color: var(--primary-color);
/* color: #fff; */
}
<button class="btn">Read More</button>
{…}are called properties, not "variables", right? They can be declared only inside rules and are bound only to elements matching selector and depending their declared inheritability cascades down in DOM tree (what is nice distinction from e.g. SASS variables). Then why would you callcolorin*{color:red}property name and--colorin*{--color:red}variable name? Maybe the only obligation to w3 could be decision to call their gettervar(), but most probably there were no better alternatives.