DEV Community

Discussion on: I front-end and hate CSS. Here's how I deal with it

Collapse
 
mxoliver profile image
Oliver

So I love styled components, but I find the second one so much more readable, the first has too many components. If all you need is some padding or minimal styling use the inline style prop or css, and then for more complex UI components use a styled component. But a million "mainDiv" components feels unnecessary. It's different to have like a Card component or TextInput as a styled component

Collapse
 
fly profile image
joon • Edited

If all you need is some padding or minimal styling use the inline style prop or css
I totally agree. That would be the optimal approach, but I found myself having an awful time when I used margins or padding in any part of my CSS.

But a million "mainDiv" components feels unnecessary
Also something I completely agree with.

Thank you very much for the constructive feedback. I will definitely attempt to apply these to the project ASAP.

Some comments have been hidden by the post's author - find out more