Closed Jab2870 closed 6 years ago
CSS
div {--highlight: blue}
span {--highlight: green}
a {color: var(--highlight)}
HTML
<div ><a>Foo</a></div>
<span><a>Bar</a></span>
Now how can Less possibly know if the fallback value is blue
or green
?. There's no way.
Closing as "Not Applicable".
People are increasingly using css variables over less variables because of their inheritance abilities.
Unfortunately, ie11.
It would be very helpful if this plugin were to add a version of the property if a fallback is specified. For example:
Currently, the above compiles to:
This would result in anchors being red in most cases. For browsers that support variables, anchors would be green if inside a div.
In a browser that doesn't support variables, anchors will be the default anchor colour.
My question is this:
Would it be possible for auto-prefix to turn
color: var(--highlight, @highlight)
into