311 Followers
88 Following
857 Posts
Hey, I’m Stephen. I'm an American expat living in Berlin with my wife and two dogs. I am a contributor to Rails and the sqlite3-ruby gem as well as the maintainer of a handful of gems aimed at making Ruby and Rails the absolute best platforms in the world to run SQLite projects.
Homepagehttps://fractaledmind.github.io
GitHubhttps://github.com/fractaledmind
LinkedInhttps://www.linkedin.com/in/stephen-margheim-5aa25bb8/
Twitterhttps://x.com/fractaledmind
After 11 long years, I am finally back in a square year. Looking forward to being 36!

Step 1: Name your anchor

.trigger {
anchor-name: --menu;
}

Step 2: Connect and position

.popup {
position: absolute;
position-anchor: --menu;
position-area: block-end span-inline-end;
}

The popup now tracks the trigger.

CSS Anchor Positioning is now baseline.

Firefox 147 ships today with full support. Chrome, Edge, Safari — all on board. Position elements relative to other elements. No JavaScript.

Here's the 60-second rundown...

Tooltips. Dropdowns. Popovers. Context menus.

All that JavaScript you wrote to keep things in viewport? Delete it.

The platform keeps winning.

`position-area` places your element on a 3×3 grid around the anchor, where `block-end` = below and `span-inline-end` = aligned right, can grow left, etc.

Play with it interactively: https://css-tip.com/position-area/

Alignment in Anchor Positioning using position-area

An interactive demo to understand how to control the alignment using the position-area property

Best part: automatic fallbacks.

.popup {
position-area: block-end;
position-try: flip-block;
}

Popup below the anchor. Not enough space? Flip it above. The browser does the math. You write the rules.

The ui- prefix matters too. When you see .btn you have no idea what you’re dealing with. Bootstrap? Old semantic class? Random utility? `ui-badge` signals intent: zero-specificity visual pattern designed to compose with utilities.

Tailwind v4’s @​utility, @​apply, and @​variant aren’t just new syntax.
Combined with :where(), they let you write semantic CSS that’s discoverable, tree-shakeable, readable, and composable.

Full write-up: https://fractaledmind.com/2026/01/02/writing-tailwind-compatible-semantic-css/

Writing Tailwind-compatible Semantic CSS | Fractaled Mind

This is my personal site, where I write about Ruby, programming, and any of my varied fascinations.

Building HTML UI forced me to figure out how to write CSS classes that integrate deeply with Tailwind v4. I want 3 things: intellisense, tree shaking, and easy utility overrides. Here’s I make it all work 🧵

@​utility ui-badge {
:where(&) {
@​apply inline-flex items-center ...;

@​variant hover {
@​apply bg-primary/90;
}

@​variant focus-visible {
@​apply border-ring ring-ring/50;
}
}
}