Hacker News new | ask | show | jobs
by al2o3cr 3557 days ago
".ComponentName-descendentName" nested inside ".ComponentName"?

Remember kids, the cascade is TEH B4DZORS - so always include everything you would have gotten from it in every class name. headdesk

Solidly delivered on the "no DRY" premise. Maybe they should coin a new acronym like "WET": "Write Everything Thrice"

5 comments

CRY: Continuously Repeating Yourself

WET: Write Everything Twice

Credit: https://roots.io/sage/docs/theme-wrapper/#fn2

:)

WET is standardly 'Write Every Time'
> "Write Everything Thrice"

Solid. I'm using that in my class today.

I love React, and even there, I only style components in the way they need to be styled, and not with any other brand-specific styles. Those go in the good ol' fashioned CSS with "gently nested" CSS selectors. The enterprise world is considerably more nuanced than many SPA devs understand.

A class of folks from US Gov, manufacturing, pharmaceutical and finance industries (to roll them into general groups) and every one of them answers "IE9" when asked what browser they have to support, and every one of them is at home with "the old ways" of writing CSS, by embracing the cascade.

It's not that they're wrong. They're pragmatic.

And, In some cases a little bitter, I'll grant you. ;)

I propose to name it the "wet-wet-wet" principle.
WETTT Write Everything Ten Thousand Times
The whole point is probably to avoid cascading and issues it creates when you will start to nest different components.
We Enjoy Typing is the explanation I usually see.