home.social

#shadowdom — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #shadowdom, aggregated by home.social.

  1. Randomly thinking about the `shadowrootadoptedstylesheets` proposal today and had some thoughts about how it could support streaming use cases better.

    github.com/MicrosoftEdge/MSEdg

    #ShadowDOM #Streaming #Web #Perf

  2. Not being able to style a shadow host using selectors like `:host:hover` or `:host:focus` is gonna be a real pain for #CSS mixins. You have to effectively break up all of your different states and can’t use nesting to make mixins that work in the light DOM and #ShadowDOM.

  3. `slotted-index()` and `slotted-count()` might be useful CSS functions for shadow DOM, since the `sibling-` ones reflect light DOM information. #CSS #ShadowDOM #WebComponents

  4. I love that you can expose a shadow part with multiple names using `exportparts`.

    ```html
    <site-header exportparts=nav-list,nav-list:header-nav-list></site-header>
    <site-footer exportparts=nav-list,nav-list:footer-nav-list></site-footer>
    ```

    #HTML #CSS #CustomElements #ShadowDOM

  5. Composition with the Shadow DOM is more powerful than you think. You can do a lot with the default named slot assignment, but manual slot assignment is a pathway to many abilities some consider to be… unnatural.</emperor-palpatine>

    knowler.dev/blog/an-intro-to-m

    #WebComponents #CustomElements #ShadowDOM #HTML #WebDev

  6. After a long while tinkering with smaller and smaller ways to build re-usable pieces of HTML, I've landed on something that is simple, and uses the browsers built-in abilities to upgrade elements.

    Introducing "ShadowRoot Injector" 🎉
    github.com/Tram-One/shadowroot

    ShadowRoot Injector is a way to declaratively define HTML, that will automatically insert when custom elements appear in the DOM. 🪡

    Check out the link and examples, and let me know what y'all think!

  7. #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