css-values icon indicating copy to clipboard operation
css-values copied to clipboard

Cover 100% of properties & values accurately

Open ben-eb opened this issue 9 years ago • 4 comments

Need to improve parsing & the code generator to be able to handle the more complex grammars, such as <color>.

ben-eb avatar Mar 16 '16 10:03 ben-eb

How could I go about trying to tackle this?

zephraph avatar Aug 02 '16 21:08 zephraph

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.

ben-eb avatar Aug 02 '16 22:08 ben-eb

https://github.com/ben-eb/css-values/commit/ac7a06c70ae5b1c095e0f44af274b79dceb55562 adds support for <color>.

ben-eb avatar Aug 05 '16 12:08 ben-eb

you're fast >_>

zephraph avatar Aug 05 '16 13:08 zephraph