Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

styled-components? 💅 #4

Open
robinmetral opened this issue Mar 12, 2019 · 3 comments
Open

styled-components? 💅 #4

robinmetral opened this issue Mar 12, 2019 · 3 comments

Comments

@robinmetral
Copy link

Are you open (for this theme or a next one) to using CSS-in-JS?

Some ideas behind it: https://mxstbr.com/thoughts/css-in-js/
I personally love styled-components, but there are many alternatives!

You could definitely say goodbye to your table of contents 😉

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------

@jasonbahl
Copy link
Collaborator

jasonbahl commented Mar 13, 2019

I vote CSS in JS as well. I think for v1 just pulling in the existing theme .scss makes sense, but long term I think the benefits of CSS in JS will help with development.

With CSS in JS along with GraphQL, we'll be able to manage components completely in one place. We can declare the Styles, Markup and data dependencies all at the component level, making it much easier to scale, reduce risks of bugs, increase developer productivity as they don't have to hunt through the application to find where things are, etc.

Then we can also take advantage of using props to conditionally change styles, etc.


Styled Components and Emotion are the 2 that I've used and both have been great!

@zgordon
Copy link
Owner

zgordon commented Mar 13, 2019

We are definitely addressing CSS-in-JS for V2. A number of us are leaning towards Styled Components :)

The issue with this for V1, as @jasonbahl said, was the additional time it takes to port SASS over to Styled Components and we wanted to get something working as soon as we could.

@robinmetral if you wanted to tackle porting twentynineteen SASS over to Styled Components, that would be a helpful step even if our current templates get tweaked a bit 👍

@m-muhsin
Copy link
Collaborator

Yes, I agree with @jasonbahl and @zgordon. I've used Styled Components a bit and this will a great time to dig deeper. Also, performance will improve as we will be loading only the styles necessary since they are attached to the relevant React components and not globally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants