universeodon.com is part of the decentralized social network powered by Mastodon.
Be one with the #fediverse. Join millions of humans building, creating, and collaborating on Mastodon Social Network. Supports 1000 character posts.

Administered by:

Server stats:

3.5K
active users

Learn more

#customelements

0 posts0 participants0 posts today

If you build a custom element and it uses a child element with a CSS shadow part to expose its base styling, e.g. ::part(base), then this will be ignored if the custom element has content-visibility: auto.

So, if you want cards with box-shadow, the shadow styling has to be on the custom element itself, or :host, not the ::part() pseudo selector.

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

blog.westbrookjohnson.comI'm feeling so disconnected

It has been a long time I put anything "more serious" out in my blog, but hey, now there is something!

In short: a dump post of my current approach and understanding of HTML custom elements and how to fit them with React and TypeScript.

There is even a practical project to look at the end, even if it isn't a perfectly polished one.

vesa.piittinen.name/blog/2024/

vesa.piittinen.nameHTML custom elementsThis is a dump of my custom elements knowledge and how to make it all work with React.

I’m already thinking about what would be great to have next year.
Yes, more CSS stuff, and especially, import attributes for CSS. Yes, more custom element stuff like a scoped registries.
But what would top my list would be tool to build and bundle CSS, HTML, and JavaScript in ways that’s aligned better with the browser as a platform.

TIL: try not to use globals in your custom elements: use `this.ownerDocument` instead of `document` and use `this.ownerDocument.defaultView` instead of `window`.

This makes your element more portable, easier to render in different contexts (server-side, service worker, etc), and it means you are always using the document and window the element is attached to… which could trip you up in the future if an element is moving between documents, etc. #dom #javascript #customelements #webcomponents

I wrote about managing complex reactive state with custom elements (web components). If you have considered building more complex / sophisticated web apps with custom elements, this is a pattern you def should know about. Also, I recommend using some sort of signals library, you’ll enjoy wiring it up to your custom elements. 🕸 #webcomponents #customelements #signals #html nathanherald.com/posts/reactiv

I‘m Nathan HeraldHow to manage reactive state using Custom Elements (Web Components)

New blog post: “A good way to hide non-defined custom elements”

blog.kizu.dev/non-defined-cust

This is a very short post about a thing that I have wanted to share for quite a while. I am pretty certain that someone already wrote about this at some point, but hey. There is so much content everywhere that it might be useful to repeat stuff, making it more likely someone will stumble upon a solution to their problem.

blog.kizu.devA good way to hide non-defined custom elementsThis is a very short post about a thing that I wanted to share for quite a while. I am pretty certain that someone already wrote about this at some point, but hey. There is so much content everywhere that it might be useful to repeat stuff, making it more likely someone will stumble upon a solution for their problem.