Gaikan
Gaikan copied to clipboard
Add support for traits
Would be nice to be able to adapt style based on current trait. Just like @media in CSS.
Do you have an example of declaration you would like to have?
Not really sure how we should do it, maybe by combining it with states?
let blueBtn = Style() {
$0.extends(otherStyle)
$0.when(state: .hover) {
$0.extends()
}
let trait = TraitCollection()
$0.when(trait: trait) {
}
$0.when(state: .hover, trait: trait) {
}
}
This would have impact on states. IMO this is not a big deal as current syntax is not great. Any comment is appreciated ;)
We could in fact handle traits this way and refactor states afterwards.