home.social

#shadowdom — Public Fediverse posts

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

fetched live
  1. React-like syntax with WebComponents.

    ​After spending some time with Lit, I really appreciated its lightweight footprint but wasn't a fan of the class-based components. While Vue offers a great approach, I still prefer the intuitive nature of React's syntax for debugging and deterministic rendering. This led me to a challenge: could I build a UI framework using WebComponents that completely eliminates the need for transpilation?

    ​I have written a breakdown of the concept, the architecture, and where I want to take it. I highly invite you to take a look, check out the code, and explore the live demo.

    * How it works: positive-intentions.com/docs/p
    * Checkout the code: github.com/positive-intentions
    * Storybook demo: dim.positive-intentions.com

    ​Please note, while the project is open-source, this is a personal exploration rather than an attempt to launch "yet another framework." It is not production-ready and is built for my own upcoming project migrations, but I am sharing it in hopes that the methodology is educational or interesting to the community.

    ​I would love to hear your thoughts on this approach. Feel free to reach out if you have any questions or want to discuss the implementation details.

    ​#WebDev #WebDevelopment #Frontend #FrontendDev #JavaScript #JS #TypeScript #TS #HTML #HTML5 #CSS #SoftwareEngineering #SoftwareEngineer #Coding #Programming #WebDesign #OpenSourceProject #IndieDev #SideProject #Tech #Technology #DevCommunity #Fediverse #FediverseDevs #WebStandards #CustomElements #ShadowDOM #VanillaJS #NoTranspiler #NoBuild #BuildStep #EsModules #ComponentDriven #UIUX #DesignSystems #TechExperiment #LearningInPublic #Developer #ComputerScience #OSS #Github #React #WebComponents #Lit #Vue #ReactJS #JSX #Storybook #TechArticle #TechBlog #TechWriting #WebDevArticles

  2. React-like syntax with WebComponents.

    ​After spending some time with Lit, I really appreciated its lightweight footprint but wasn't a fan of the class-based components. While Vue offers a great approach, I still prefer the intuitive nature of React's syntax for debugging and deterministic rendering. This led me to a challenge: could I build a UI framework using WebComponents that completely eliminates the need for transpilation?

    ​I have written a breakdown of the concept, the architecture, and where I want to take it. I highly invite you to take a look, check out the code, and explore the live demo.

    * How it works: positive-intentions.com/docs/p
    * Checkout the code: github.com/positive-intentions
    * Storybook demo: dim.positive-intentions.com

    ​Please note, while the project is open-source, this is a personal exploration rather than an attempt to launch "yet another framework." It is not production-ready and is built for my own upcoming project migrations, but I am sharing it in hopes that the methodology is educational or interesting to the community.

    ​I would love to hear your thoughts on this approach. Feel free to reach out if you have any questions or want to discuss the implementation details.

    ​#WebDev #WebDevelopment #Frontend #FrontendDev #JavaScript #JS #TypeScript #TS #HTML #HTML5 #CSS #SoftwareEngineering #SoftwareEngineer #Coding #Programming #WebDesign #OpenSourceProject #IndieDev #SideProject #Tech #Technology #DevCommunity #Fediverse #FediverseDevs #WebStandards #CustomElements #ShadowDOM #VanillaJS #NoTranspiler #NoBuild #BuildStep #EsModules #ComponentDriven #UIUX #DesignSystems #TechExperiment #LearningInPublic #Developer #ComputerScience #OSS #Github #React #WebComponents #Lit #Vue #ReactJS #JSX #Storybook #TechArticle #TechBlog #TechWriting #WebDevArticles

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

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

    github.com/MicrosoftEdge/MSEdg

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

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

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

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

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

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

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

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

  13. 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!

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

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

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

    #webdev #webcomponents

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

    #webdev #webcomponents