No, seriously, the shadow DOM sucks
gomakethings.com·6d
🧩Web Components
Preview
Report Post

Yesterday’s article on why the shadow DOM sucks may have been one of the most hated pieces I’ve written in a while.

But I stand by what I said, and today I wanted to respond to some of the comments I got.

Let’s dig in!

“Global styles can break your component.”

This is true… if CSS is badly written.

If your component relies on very generic class names, global CSS with the same name can break it.

<accordion-group>
<h2 class="heading" aria-expanded="true"><button>Some heading</button></h2>
<div>Some content...</div>
<!-- ... -->
</accordion-group>
.heading button:after {
/* ... */
}

accordion-group div {
/* ... */
}

These styles…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help