Egor Kloos

Design Systems, CSS, Web Components, Photography, Food, HiFi. All the good things in life should be cherished and savoured. Toots are my own - he/him - Gen X - 🇳🇱🇮🇪

Blog: dutchcelt.nl

Work stuff: As a Design System Engineer/Architect, I always look at how web stacks implement a design.
Design is never an add-on; it's an integral part of the solution.

Egor Kloos boosted:
Aaron GustafsonAaron@front-end.social
2026-03-05

People are not static, we are dynamic. In order to meet our needs at any point in our lives or day, the UIs we create must be able to adapt to us — not the other way around. linkedin.com/posts/derekfeathe

Egor Kloos boosted:
annaecookannaecook
2026-03-02

People got upset when GitHub (rightfully) called out usability/accessibility issues with toasts.

And now, I have to deal with some thought leaders’ anti take on it to my teams because they wanted to get attention for playing devils advocate.

Tech “thought leaders” tend to make my job harder 🙃

Egor Kloos boosted:
Peter Krönersir_pepe
2026-03-02

🚩✊️️ TGIF, because Friday is Dependency Deletion Day! It has come to my attention that some folks STILL use lodash because of… cloneDeep?! I see about 150,000,000 weekly downloads for this ancient function on NPM, but come on—we've had structuredClone for some time, and it's better in every way.

👉️ developer.mozilla.org/en-US/do

Egor Kloos boosted:
CSS by T. Afif :verified:css@front-end.social
2026-02-27

Can you guess which one is a valid syntax for style queries?

Think about it, then read my last post to find the correct answer (and understand why you got it wrong)

css-tip.com/if-trick/

#CSS #HTML

The following CSS code:
.box {
  --n: 3;
  background: green;
  /* #1 */
  @container style(var(--n) = 3) {
    background: red;  
  }
  /* #2 */
  @container style(--n = 3) {
    background: red;  
  }
  /* #3 */
  @container style(calc(6/2) = --n) {
    background: red;  
  }
  /* #4 */
  @container style(var(--n) = --n) {
    background: red;  
  }
}
Egor Kloos boosted:
Manuel Matuzovićmatuzo@front-end.social
2026-02-27

When you don't put `aria-hidden="true"` on decorative SVGs, they'll be announced by some screen readers.

#WebAccessibilityFails

matuzo.at/blog/2026/put-aria-h

Egor Kloosdutchcelt
2026-02-26

@sarajw I do carry a water bottle around. The dehydration is real, so are ever-increasing toilet breaks. 😅

Egor Kloos boosted:
Firefox for Web Developersfirefoxwebdevs
2026-02-25

You can throw away innerHTML and replace it with the new setHTML(), which has a built-in sanitizer. Here's how it works:

Egor Kloos boosted:
CSS by T. Afif :verified:css@front-end.social
2026-02-19

💡 CSS Tip!

For years, we've had the "z-index, stacking context" nightmare, but we will soon have a worse nightmare related to Anchor Positioning 😱

When it doesn't work, it's frustrating, so it's time to learn how it really works.

css-tip.com/anchor-issues/

It's not as simple as you might think!

#CSS #HTML

Egor Kloos boosted:
Peter Krönersir_pepe
2026-02-18

Somebody on LinkedIn asked for my approach to global CSS in with Shadow DOM:

1. Import CSS as Strings (via Vite)
2. Shove CSS into the CSSStyleSheet Constructor
3. Add the results to the ShadowRoot's adopted stylesheets
4. Delete all of the above once Safari supports CSS module scripts

This is how you future-proof your projects: be aware of what's coming to the platform and prepare your workarounds to be easily removable when the new features arrive ✨

Snippets of (by itself not really useful) JS code that illustrate the main message without much benefit.
Egor Kloosdutchcelt
2026-02-11

@jensimmons I’m using LLMs for some things more regularly. It helps with incrementally documenting my work. I'm sometimes surprised how well it does. But it still requires a lot of checking and redaction. So, not a win for productivity.
Also, they are still awful at working on existing CSS code bases. Not sure what's going on there.

Egor Kloosdutchcelt
2026-02-08

@tbroyer I'm now only using manual slot assignment. So no more attribute toggling. The approach also no longer needs any event listeners due to the way the 'manual' slot assignment needs to work. The menu-bar now uses a `requestAnimationFrame` to make sure it can calculate the menu positions before moving stuff around. There is a risk of flashing or missing menu items.

Egor Kloosdutchcelt
2026-02-07

@tbroyer I've removed the 'slot' selectors and am now using CSS State. So styling is now entirely in the Shadow DOM.
Looking into manual slot assignment, but may keep the custom event, as that seems a better/faster fit. Thanks for the insight into alternatives.

Egor Kloosdutchcelt
2026-02-06

@tbroyer I’ve avoided `slotchange` events in the past because I’ve found them a bit flaky and verbose. The custom event is fired when I know I can get the rendered position.
However, it is worth considering whether I can avoid adding slot attributes. I can use css states as a replacement for the host slot selectors.

Egor Kloosdutchcelt
2026-02-06

The combination of Custom Element Slots, the Popover API, and CSS Anchor Positioning enables complex navigation menus, with the browser doing most of the lifting.

codepen.io/dutchcelt/project/e

Egor Kloosdutchcelt
2026-01-31

@stuffbreaker The first point isn't a deal breaker. Could even speed things up. But it can't be a default in a library, for example.
The last point is a bit trickier but more impactful. I'll take another look at the approach.

Egor Kloosdutchcelt
2026-01-31

@stuffbreaker I gave your snippet a little spin using `content-visibility` in this little menu demo using slots
codepen.io/dutchcelt/project/e

Egor Kloos boosted:
Burton Smithstuffbreaker
2026-01-31

I've been trying to think of a way to reduce the flash of unstyled content (FOUC) when using , with something I could add to my reset that doesn't require .

Here's what I came up with:

A CSS snippet for reducing FOUC with web components:

body:has(:not(:defined)) {
  opacity: 0;
  transition: opacity 0s 50ms;
}
Egor Kloos boosted:
2026-01-27

I wrote a new article: “Solving Shrinkwrap: New Experimental Technique”

kizu.dev/shrinkwrap-solution/

In this article, I present my new technique for solving a #CSS problem that was deemed impossible — true shrinkwrapping of an element with auto-wrapped content.

By using anchor positioning and scroll-driven animations, we can adjust our element’s outer dimensions by measuring its inner contents, demonstrating that for many cases this can already work and might unlock a future native feature.

A screenshot of one of the article’s examples. On a white background, there are several boxes visible in a three-dimensional view. The one in the back has rounded corners, green background and a pink outline, and is shorter. The one in the middle is longer, going the full width of the screenshot, and has a pink background. The one in the front has the following text: “I am a Longer Header; I Will Wrap & Look Bad! Oh no! What Can We Do?”, wrapped after the ampersand and balanced.
Egor Kloos boosted:
CSS by T. Afif :verified:css@front-end.social
2026-01-27

People are debating the masonry layout, and I'm creating strange layouts.

A Pyramidal Grid of Hexagon Shapes! 👀

css-tip.com/pyramidal-grid/

A fully responsive implementation powered by modern CSS (corner-shape, sibling-index(), math functions, etc.) and no media queries.

#CSS #HTML

Egor Kloosdutchcelt
2026-01-23

@sl007 @jensimmons @jaffathecake I get your concern. But it’s usually a difference in opinion or approach. That seems more resolved than I’ve seen it in a long time. Hence my excitement.
For what’s its worth, Firefox is on a roll. Let’s ff’ing go!

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst