You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ok so given we must return a component (because we can't pass props to the rendered element if we don't, see #19), we need another way to conditionally apply styles.
Except now we don't have a tagged template literal to work with. So if we want to use anything advanced with the interpolations we'd have to do styled.div(props => css...). I'm still not convinced that we should go down the all-strings-all-the-time route.
So we need a better way of doing conditional styles from props.
Activity
geelen commentedon Sep 13, 2016
I missed this. This is awful. Let's fix this.
geelen commentedon Sep 14, 2016
Ok so given we must return a component (because we can't pass props to the rendered element if we don't, see #19), we need another way to conditionally apply styles.
This works but is ugly:
Because
styled.div``` returnsprops => createElement()` you can call it directly passing the props onwards and it's all ok. But it looks horrible.We could make this work too:
Except now we don't have a tagged template literal to work with. So if we want to use anything advanced with the interpolations we'd have to do
styled.div(props => css...). I'm still not convinced that we should go down the all-strings-all-the-time route.So we need a better way of doing conditional styles from props.
geelen commentedon Sep 14, 2016
This is a better way to do conditionals: #24