This is a basic example of my attempt to use flow type to be able to do some basic validation on styles defined in a CSS-in-JS manner, as in aphrodite.
An example of a style definition in Aphrodite being:
const styles = StyleSheet({
myClassName: {
color: '#000',
width: '100%'
}
})
I managed to get a basic flow/type annotation working so that I can validate the style properties. It gives me basic support against typos (e.g. "colour") and invalid style tag usage, however I am struggling with dynamically structure properties, such as media queries:
const styles = StyleSheet({
myClassName: {
color: '#000',
'media (min-width: 500px)': {
color: '#FFF',
}
}
})