#shadowdom

Brandon Zhang 🇨🇳heybran@mastodon.online
2025-05-24

#WebComponents people, in this Codepen that I set up for testing, the dialog inside the #ShadowDOM cannot be open by its sibling button even enough they're connected by correct ID attribute.
Is this expected or am I missing something here?

codepen.io/brandonzhang/pen/Qw

2025-05-14

shadow parts are pretty good actually.

#shadowdom #webcomponents

Peter Krönersir_pepe
2025-05-14

How do I figure out the total number of DOM nodes in a page, _including_ , open and closed?

Inautiloinautilo
2025-04-22


All browsers get this wrong · What DevTools misinterpret about Shadow DOM ilo.im/163dax

_____

2025-04-07

I'm in total agreement with this post: gomakethings.com/the-shadow-do - the ability to have a global CSS system is something that has been encouraged for YEARS as a matter of reducing the download footprint, yet shadow dom discourages this.

And there shouldn't be any technical reason why slots should require shadow. take this declared child, move it to that spot in my html structure. It can be (and has been) faked by multiple frameworks including lit, stencil, and JET.

'generic' web components that use internal CSS to define the layout, and then rely on a global css system to be flexible in appearance, is what we web-devs really want.

#javascript #webcomponents #shadowdom

2025-03-18

New Kitten release

• Now leaves <style> tags within <template> tags alone when collating and normalising the CSS on a page so as not to interfere with scoped styles in declarative shadow DOM.

(Kitten’s Streaming HTML workflow¹ – which uses htmx and WebSockets under the hood – combined with built-in support for slots, etc., in Kitten components² means the use of declarative shadow DOM is mostly useful if you want scoped styles. Ideally, of course, use classes to scope styles to your components and be specific in your CSS selectors in general so as not to pollute elements in your components. Although that’s a bit like saying you should floss everyday. Yeah, we all know we should…) :)

Update: All that said, I’d highly recommend you don’t use Shadow DOM in your Kitten apps. For one thing, htmx’s WebSocket extension doesn’t seem to play well with it. And for another, you really don’t need it and definitely not just to get scoped CSS.

Enjoy!

:kitten:💕

¹ kitten.small-web.org/tutorials
² kitten.small-web.org/tutorials

#Kitten #SmallWeb #SmallTech #CSS #CSSScoping #ShadowDOM #shadowRoot #DOM #HTML #JavaScript #JS #style #template #declarativeShadowDOM #NodeJS #web #dev

Screenshot of code (left) and browser output (right).

Code:

<p>I am regular root</p>
<div>
  <template shadowrootmode='open'>
    <p>I am shadow root</p>
    <slot></slot>
    <style>
      p { color: red; }
    </style>
  </template>
</div>
<p>I am also regular root</p>
<style>
  p { color: blue; }
</style>

Browser output shows “I am regular root” in blue, “I am shadow root” in red, and “I am also regular root” in blue.
štěpánstepan@f.cz
2025-02-22

Wtf is #ShadowDOM and can it please go away?

westbrookwestbrook
2025-02-06

In that it was dropped as part of a thread that you might have otherwise been uninterested in, sharing this again to start your Thursday:

blog.westbrookjohnson.com/patt

Catch up on some techniques for managing connection time work in a custom element. 😁 There's even reasons for using shadow DOM hidden in there. 😱

Thanks @nachtfunke for starting the convo on this and @zachleat for challenging a toot into a full on blog dump. 🙇

westbrookwestbrook
2025-02-05

@zachleat @nachtfunke I'm not saying this is because I didn't get you anything for your birthday, but I'm also not saying it isn't because of that...

blog.westbrookjohnson.com/patt

Burton Smithstuffbreaker
2025-02-02

This is a re-post since I don't see Keith on here:

Call to action for / fans: I've added an experimental flag to Firefox lifting the restriction on adoptedStyleSheets, meaning shadowroots can adopt `link.sheet` or `style.sheet`.

Please try this out, and let me know if you encounter issues!
github.com/w3c/csswg-drafts/is

2025-01-31

github.com/w3c/csswg-drafts/is

Call to action for #WebComponent / #ShadowDOM fans: I've added an experimental flag to Firefox lifting the restriction on adoptedStyleSheets, meaning shadowroots can adopt `link.sheet` or `style.sheet`.

Please try this out, and let me know if you encounter issues!

pablolarahpablolarah
2024-12-29

🔵 Declarative Shadow DOM
By Schalk Neethling @schalkneethling
Declarative shadow DOM enables seamless server-side rendering for the web platform.
at Stephanie Eckles @5t3ph 12 Days of Web

12daysofweb.dev/2024/declarati

Text on green rhomboid:
6 Dec 18
Orange text on cyan background:
Declarative Shadow DOM
Inautiloinautilo
2024-12-12


Isomorphic web components · Who says web components can’t be rendered server-side? ilo.im/161cdx

_____

CuriousCoderchopsueey
2024-12-03

What is the Shadow DOM?

The is a web standard that enables encapsulation of and ,
allowing developers to create components with isolated styling and structure.

Those so called web components are like custom HTML-Elements, but with all the utilities and properties of built-in HTML-Elements. You can roughly think of it like React Components, but with plain VanillaJS.

developer.chrome.com/docs/css-

pablolarahpablolarah
2024-11-22
Green text projecting shadows on red/white duotone illustrated entrance with columns:
The Shadow DOM is in the front
Inautiloinautilo
2024-11-21


Combining light DOM and shadow DOM · How to mix-and-match both in a web component ilo.im/160yn2

_____

westbrookwestbrook
2024-11-19
pablolarahpablolarah
2024-11-19

🟣 Combining light DOM and shadow DOM in a Web Component

by @cferdinandi.bsky.social

gomakethings.com/combining-lig

Violet illustration of man with umbrella and hat projecting a shadow that looks like his carrying a person. 
Violet text: Combining light DOM and shadow DOM in a Web Component

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst