yeojz / metalsmith-react-templates

A metalsmith plugin to render files using React / Preact / JSX based templates.
MIT License
92 stars 17 forks source link

Using styled-components? #58

Open varya opened 6 years ago

varya commented 6 years ago

I have my website on metalsmith using metalsmith-react-templates as templating solution + webpack static build for CSS and JS to link. Now I am trying to use styled-components (https://www.styled-components.com/) together with metalsmith-react-templates and I am lost :-) To my understanding, the main obstacle is that styled-components assume that all the styles are inlined into <styles> tag, whereas metalsmith-react-templates approach is that styles are generated separately and linked traditionally via template. Can you please suggest how to handle this or did you probably see examples? Thanks!

yeojz commented 6 years ago

Hi @varya

Underlying this, we're still depending on babel for transpilation. Would it do to use the babel-plugin of styled components? I personally haven't tried styled-components with this yet.

If not, maybe can elaborate on the final outcome on what you're trying to achieve and I'll look into it.