DEV Community

Discussion on: Styled components: what, why and how?

Collapse
 
christopherkade profile image
Christopher Kade

How does it show a lack of understanding CSS?

The CSS attributes used are the exact same & it is eventually transpiled to actual CSS

Collapse
 
mujaddadi profile image
Taha Hassan Mujaddadi

I was referring to yours these sentences "CSS is global by nature." and "And yet its very nature is something that is often disliked by many people, as changing a value somewhere can "break" something elsewhere. That's where CSS scoping comes into play.".

I have been working with CSS for almost 11 years now and I don't have the issues you mentioned. If you define a style for an element, it will be of course global. If you use classes, it will be specific. In fact CSS' global nature is it's one of the powerful feature as it help developers from writing duplicate styles. If we understand, the specificity and cascading nature of CSS, these issues never comes. I blame the frameworks such as Bootstrap for this that it made people not to learn basic rules of CSS.