astroturf
astroturf copied to clipboard
Update README for greater consistency with styled API
I think it would be more convenient for users who switch from styled-components
Reference #33
Also it is a little shorter
wait this works? @jquense why don't we use this then
@taion yeap, @jquense added this syntax to fix my old issue https://github.com/4Catalyzer/astroturf/issues/33
I think it's less good of a syntax personally, with styled()
you use the same function call for dom elements or custom components, it's also a bit less error prone.
Happy to show it in the readme but I think we should prefer the function generally
@jquense yeap, we can do it in a different way. We just need to explain for styled components users that they do not need to change the syntax. Do you have an idea how to do it?
@jquense I think astroturf should attract styled/emotion users and README will show them that migrating is not so difficult. This is why I think it is important for us to use SC syntax.
for sure we should show it and illustrate a migration path, I just don't think we should do so at the expense of now using the other syntax at all.
Can we add a section that shows both? and/or some copy for folks coming from SC or emotion?
Maybe it is a good time to write a special section for Migration from SC. We can cover there:
- Syntax difference. Show what is supported.
- Show workaround for
keyframes
andinjectGlobal
. - Explain how to set constants (use
postcss-custom-properties
orpostcss-env-function
). - How to have dynamic parts in styles (Custom Properties).