Open ben-eb opened 8 years ago
How could I go about trying to tackle this?
I've changed a lot about how this works now, hopefully it's less magical! For color
specifically, I think it would be better to have a function that could validate any colour. So, we can start with https://github.com/ben-eb/css-values/blob/90a8116494cc8e35cdc672e32462f2faa1385fde/data/data.json#L6584 as a reference point; we need to be able to validate each of these value types (except the deprecated system colours, not bothered about supporting those).
So once we have an isColor
validator, we'll need to have a special case in the property generator, as currently each of the validators accept a value
rather than a node
from postcss-value-parser
. Perhaps that warrants changing first?
https://github.com/ben-eb/css-values/issues/8 is a good starting point if you want to get stuck in.
https://github.com/ben-eb/css-values/commit/ac7a06c70ae5b1c095e0f44af274b79dceb55562 adds support for <color>
.
you're fast >_>
Need to improve parsing & the code generator to be able to handle the more complex grammars, such as
<color>
.