Show keystrokes on a website with the <show-keystrokes> custom element

When recording screen casts or doing live demos, I typically rely on a native macOS app to visualize my keystrokes on screen. Recently, however, that app got blocked on my work machine by a corporate security policy. Additionally, the keystrokes visualized through that app don’t show up when screen sharing a specific window or tab.

Because I needed to demo a website that relies heavily on keyboard navigation — and thus really needed those keystrokes to be visible to the audience — I found myself in a bit of a pickle. So with the help of Gemini, I decided to build a web-native solution to fill that gap: <show-keystrokes>

New in Chrome 154: iframes that automatically resize themselves to their content

Chrome 154 adds support for responsively-sized iframes, letting an <iframe> size itself based on the intrinsic size of its embedded document. This is perfect for seamlessly embedding third-party comment widgets, varying-height social media embeds, or any other type of embed that uses an <iframe>.

Ship cleaner packages (without the ./dist or ./src folder) by publishing a subfolder to NPM

One detail that has always bugged me about publishing a package to NPM is how build output paths like dist/ can leak into the public API.

Turns out, npm publish can do it, but to make it work seamlessly in a real-world project, you need a few extra pieces in place. Let me walk you through how it works.

Introducing <rich-input>, a GitHub-like search/filter text input to embed on your site

While working on a side-project to better navigate and search through my record collection, I found myself in need of a rich search input: one that accepts free-form text alongside structured filters like artist:“Aphex Twin” or label:“Warp Records” — You know, like the one you see on GitHub when searching/filtering issues.

When I quickly realized a standalone custom element for this didn’t exist yet, I nerd sniped myself into building curating one.

WebKit supports interactive-widget … and hopefully Safari will too?

About a month ago, WebKit gained support for interactive-widget. While it’s not clear whether this will end up in Safari or not, this is pretty exciting news: If you have ever had a virtual keyboard obscure your fixed navigation bar, then interactive-widget is for you.

This post details a quick recap of what the feature does, how we got here, and a sneak peek at it running in WebKit.

Introducing <mermaid-element>, a custom element to display Mermaid diagrams

Today I learned that CodePen supports Mermaid diagramsChris Coyier has a a whole collection with examples here — and I also learned that there is no custom element to easily include these in your markup … so I built one.

Animating CSS Grid Layouts with CSS Anchor Positioning

At CSS Day (back in June), someone asked me how Brave (the browser) might have built their New Tab Page which features some tiles laid out in a grid. While the grid is nothing spectacular, something special happens with it when you resize the viewport: as the available space changes, the grid nicely reorganizes itself in an animated way. The animations are also interruptible, so no View Transitions seem to be at play.

So, how did they do it? I’m not sure. But if I were to recreate it, I’d use CSS Anchor Positioning with regular CSS Transitions on top.

Introducing <hic-pageflip>: A Pageflip/Flipbook Custom Element powered by HTML-in-Canvas

Way back in 2005, I used a Flash PageFlip component to display a book on a website. Ever since, recreating a modern version has been on my backlog to investigate. With the arrival of the experimental HTML-in-Canvas API, we can finally bring it back — this time displaying real HTML.

Feature Detecting “Undetectable” CSS Features with @supports named-feature()

In CSS you can feature detect support for things like selectors, properties + values, and at-rules using @supports. But how do you feature detect a change to an underlying implementation, or two existing properties suddenly working together? Enter @supports named-feature(), a function designed to expose these specific capabilities without relying on hacky workarounds.

The Future of CSS: Target Multiple Classes with the Class Prefix Selector

To target multiple classes that share the same prefix, you’d typically have to resort to adding an extra base classes to your markup or to using badly performing attribute selectors. To make things easier, CSS is getting a new selector: The Class Prefix Selector (.prefix-*).