react-graphql-github-apollo icon indicating copy to clipboard operation
react-graphql-github-apollo copied to clipboard

CSS-in-JS

Open nick-walt opened this issue 6 years ago • 6 comments

Hi Robin, this looks awesome. Would you consider converting your CSS into styled-components? Including layout components with Grid Layout and Flexbox? Cheers :)

nick-walt avatar Mar 08 '18 21:03 nick-walt

I was thinking of the same idea, after reviewing the code...

https://material-ui-next.com/customization/css-in-js/

The above explanation is a great use case for the css-in-js

https://oliviertassinari.github.io/a-journey-toward-better-style

Along with this presentation...

stormasm avatar Mar 09 '18 17:03 stormasm

However, it would be a lot of refactoring.... And in thinking about it further I am not sure it would be worth the effort. But at least there is some information here if you are curious...

stormasm avatar Mar 09 '18 19:03 stormasm

This is a short article on styled-components which shows some great benefits, including simpler more semantic JSX: https://medium.com/@jamiedixon/styled-components-production-patterns-c22e24b1d896

nick-walt avatar Mar 10 '18 06:03 nick-walt

I hesitated a bit to reply to this issue. I like the idea of using CSS grids, but on the other hand wouldn't want to add complexity to the repository itself. The focus shouldn't be on the style here, that's why I used simple CSS in the first place. What do you and others think about it? If I am the only one thinking this way, then we should go for your proposal! 👍 😃

rwieruch avatar Mar 10 '18 08:03 rwieruch

Yeah, good point. I was thinking it would be a great example of CSS-in-JS. Maybe those interested can refactor offline to experiment. I'll have a crack :)

nick-walt avatar Mar 11 '18 05:03 nick-walt

Please post here after you do your experiment and/or if others do as well... Thanks !

stormasm avatar Mar 11 '18 05:03 stormasm