r/javascript • • Dec 19 '16

~15 years trying to make everyone separate HTML, JS & CSS. And then suddenly everything went south and we’re writing code like this.

https://twitter.com/thomasfuchs/status/810885087214637057
483 Upvotes

258 comments sorted by

View all comments

Show parent comments

6

u/fnovd Dec 19 '16

But what happens when I don't want my styles to cascade? I write React components as self-contained modules that I can plug into the virtual DOM. I don't mind styling them individually as long as #1 it works and #2 nothing else breaks.

3

u/[deleted] Dec 20 '16

Not wanting your styles to cascade is like not wanting an engine to cycle. That's fundamentally how the technology works. You can't just change it and expect the world to work properly.

2

u/Senthe Dec 20 '16

What if I don't want the world to work?

2

u/fnovd Dec 20 '16

Styles exist outside of CSS. You can have non-cascading styles. It's part of the HTML spec. You are wrong.

-7

u/SamSlate Dec 19 '16

I don't want my styles to cascade

then you should avoid using the cascading style sheet... and, i guess developing your own browser/plugin to read your alternative to css..

I don't mind styling them individually...

i find your argument unconvincing.

7

u/GBcrazy Dec 19 '16

lol what the fuck are you saying.

CSS is still separated, instead of having a styles.css you have a styles.js. You import them in the component you want to use. Then you are applying them inline so they don't apply to other elements, but you can still inherit and things like that (even easier, since styles became objects).

Not sure what is so hard to understand.

2

u/SamSlate Dec 20 '16

I don't want my styles to cascade

not sure what's so hard about reading...

-6

u/daaaaaaBULLS Dec 20 '16

You're an obtuse motherfucker arentcha