datamade / how-to

📚 Doing all sorts of things, the DataMade way
MIT License
87 stars 12 forks source link

Styled components: Yes or no? #376

Open hancush opened 3 weeks ago

hancush commented 3 weeks ago

Background

I recently used styled components for the first time, and it was really nice! The main reason is was nice is that I could pass variables to create new styles on the fly, instead of writing (and maintaining) many minimally different CSS classes. Styled components are slightly polarizing in the React community – do we want to incorporate them into our React repertoire?

Proposal

Research opinions and patterns on styled components.

Deliverables

A little document summarizing pros and cons and, if there are sufficient pros, recommending use cases for DataMade.

Timeline

A day.

hancush commented 3 weeks ago

This observation is based:

The thing that made me love React is that it gives you a way to pack logic (state, effects) and UI (JSX) into a reusable box. A lot of folks focus on the "reusable" aspect, but in my opinion, the cooler thing is that it's a box.

https://joshwcomeau.com/css/styled-components/