Liskov’s Gun: The parallel evolution of React and Web Components

https://www.baldurbjarnason.com/2024/liskovs-gun/

This is a bit of an experiment. Probably the longest essay I've published directly on my website. 🙂

Liskov's Gun: The parallel evolution of React and Web Components

Web dev at the end of the world, from Hveragerði, Iceland

@baldur
> The CSS property display: contents; also goes some way to alleviate this issue as it can be used to effectively “disappear” the custom element from the rendering tree, so it doesn’t interfere with, for example, the parent-child relationship between a <ul> and <li> element.

This is not how I at least understood `display: contents`. It rather keeps the DOM meaning as defined when it comes to semantics, and just skips the element when it comes to, well, displaying it.

https://hidde.blog/more-accessible-markup-with-display-contents/#heading-4
@hdv here explores a use-case of adding `display: contents` to `<ul>` to make `<li>` grid items for *styling* while keeping it a list for semantics. So `display: contents` doesn't alleviate the `<ul><my-el><li>` situation if that's what you were suggesting.

More accessible markup with display: contents

<p>With <code>display: contents</code>, we can have more accessible markup for our CSS Grids. One caveat: supporting browsers currently break this.</p>

Hidde's blog
@thesdev @hdv Ah, I think you're right! I'll have to update the essay
Liskov's Gun: The parallel evolution of React and Web Components

Web dev at the end of the world, from Hveragerði, Iceland