DEV Community

Discussion on: How do I organize my CSS code for components?

Collapse
 
madrafj profile image
Ahmad Rafsanjani

It's new to me. I never try nested CSS before. Is it only works on SASS or not? Sorry I don't know a thing about SASS.
Anyway it's interesting, it's like you create a class inside CSS. It makes you easier to find your code. At first, I thought *this * will bulk your code, but if you put general properties in higher level it won't be an issue.
Nice article, I learned a lot from this. I'll give it a try in my next project.

Collapse
 
xilenomg profile image
Luis Perez

It works only on SCSS or SASS. I had to mention that. SASS basically will convert this code into css. You can use variables for colors for example so u dont need to rewrite same hex all the time. There are many benefits (and few cons on my point of view) using SASS.

I think it’s much more organized than pure css and the way i wrote in this article is working for some time already without any change.

Thanks for your comment!

Collapse
 
madrafj profile image
Ahmad Rafsanjani

You're welcome