| ▲ | HTML Traits(github.com) |
| 16 points by nymanjon 2 days ago | 5 comments |
| |
|
| ▲ | cdaringe 19 hours ago | parent | next [-] |
| I kinda see it. As a non HTMX user, it kind of feels like a “build your own” HTMX substrate |
| |
| ▲ | nymanjon 15 hours ago | parent [-] | | I could see it used for something like that. But it is more general as it can act upon any HTML element. So, you could use it for masking an input element or any other local state based element. Granted, it doesn't need to be limited to local, but at that point HTMX, Datastar, html-form, etc might make more sense. html-form is the one I made out of those and it is more single focus using the native platform. |
|
|
| ▲ | 2 days ago | parent | prev | next [-] |
| [deleted] |
|
| ▲ | mock-possum 2 days ago | parent | prev [-] |
| Kinda fun, so you’re tagging HTML elements with JS traits the same way you’d tag them with CSS classes. Very much a shame it explicitly does not work with the ShadowDOM though. |
| |
| ▲ | nymanjon 2 days ago | parent [-] | | So, what use case would you see with ShadowDOM? I see this more as a way to progressively enhance an element. But in my own use of web components I haven't seen a need for ShadowDOM, but I'm usually just progressively enhancing my page and adding behaviors to my elements. I can see a use case for ShadowDOM when completely creating a new element, but at that point it makes sense to just use a regular web component. Maybe I'm wrong. But that is the reasoning I'm using. |
|