Open tad-lispy opened 8 years ago
You are basically asking for a JSON version of the CSS specification :) I think this would be an interesting thing to do, but likely the weight would not be worth shipping in production Radium.
Seems like we only need properties and values + media queries + state pseudoclasses, but without selectors, pseudoelements and more esoteric features like variables. For starters I'm thinking about listing all the possible properties. Even this seems like a big challenge - it's hard to find comprehensive list of them.
Side note: someone did it for React Native: https://github.com/awnist/react-native-style-json-schema/blob/master/src/schema.cson. It doesn't seem complete though.
The React Native list won't help us, they purposely only support a specific subset of CSS.
There is an official list of all properties with possible values for CSS 2.1, but anything above it (so called CSS 3) is a huge mess of overlapping recommendations. Most of them have property index
, so it may be possible to extract something from there.
/cc @chameleonlizzard
Seems like @rtfeldman did something similar for Elm https://github.com/rtfeldman/elm-css/
Is there any schema definition for Radium style? I may need to implement one in JSON Schema format and would like to avoid re-inventing the wheel. Any advice would be highly appreciated :)
Do you think this project would benefit from such a formal definition? I'm thinking #610