lukesutton / uut

Can you write CSS using pure Swift? Yes you can.
MIT License
0 stars 1 forks source link

Implement CSS variables #5

Open lukesutton opened 8 years ago

lukesutton commented 8 years ago

It's likely they may need to use something clever like generics to work. Existing property values could be extended to take a CSSVariable, but for type safety, we need to make sure invalid types can't be provided.

lukesutton commented 8 years ago

We should be able to do something like CSSVariable<V: StringConvertibleValue>. Then it's completely generic. The only requirement is that the value can be converted into a string. In use, for something like a color property, it could be restricted CSSVariable<PropertyValues.Color>.