DEV Community

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

Collapse
pozda profile image
Ivan Pozderac

I have vast and long CSS experience and I do not hate it but still I prefer styled components much more than other CSS solutions.

I also tend to separate component styling in separate file and just import it in the file where it is used.

I had chance to see components with styles defined in the same file and it looked like unreadable mess in cases where there were too many components with big list of declarations.

Also big plus for me is altering component styling on the fly depending on passed properties, no more toggling classes or using cx and defining cases!

Collapse
fly profile image
joon Author

Thank you for the constructive feedback Ivan!

I also tend to separate component styling in separate file and just import it in the file where it is used.
This is something that I attempted to do at first, but ended up sort-of ignoring(probably because of laziness, which is something I believe one should never do since it all returns as technical debt).

I had chance to see components with styles defined in the same file and it looked like unreadable mess in cases where there were too many components with big list of declarations.
I completely agree with this. I had begun to feel this while coding, but I think I ignored it for some reason.

Also big plus for me is altering component styling on the fly depending on passed properties, no more toggling classes or using cx and defining cases!
Also something I completely agree with. I began using this 12 hours ago before I went to bed :)

I wish I could give more likes. I vastly appreciate your feedback.

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