DEV Community

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

Collapse
 
kbrackson profile image
Kayla

How long have you been 'front ending'? CSS is your biggest friend is you want scalable, semantic code. This example actually made me think the inverse of what you were trying to argue, but thank you for helping me out it into words - this code might be great for a single freelance developer in limited cases, but so semantically messy and bloated that any team member would just label this as spaghetti and wouldn't even bother refactoring it.

I would suggest investing in reading up on pug / scss (mixins + variables in your build) with your react (or vanilla, or vue, or whatever.js) - have it output your SCSS or LESS into CSS for you (use prettier at runtime if you need to, with most compilers), then you can dig in later.

Also worth checking out: BEM, prettier, and other CSS naming / cleaning tools.

Collapse
 
fly profile image
joon

Thank you for the feedback Kayla!

so semantically messy and bloated
I couldn't agree more :)

SCSS or LESS into CSS for you
I never considered using SCSS and LESS because although I heard that they are great, it just felt like more CSS. But I kind of get the impression that styled-components do pretty much the same thing, is there any particular reason why you recomment SCSS or LESS?

BEM, prettier, and other CSS naming / cleaning tools.
Never heard of BEM before, will definitely try it out if it helps writing CSS.
Thanks a lot!

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