More flexible restyle functions
mrjackdavis opened this issue · 0 comments
mrjackdavis commented
Hey!
I think restyle functions could be way more powerful if you could set multiple and arbitrary style properties.
Consider this
const theme = {
//...
elevations:{
'$1':{
shadowColor: '#000',
shadowOffset: {width: '0pt', height: '2pt'},
shadowOpacity: 0.2,
shadowRadius: '3pt',
}
}
}
<Card elevation='$1' />
Where the resulting style object would contain
{
shadowColor: '#000',
shadowOffset: {width: '0pt', height: '2pt'},
shadowOpacity: 0.2,
shadowRadius: '3pt',
}
I'd like to write a restyle function to do this, but I am restricted by the 1:1 relationship between property
and styleProperty