-
Stylish
<dialog>sCampsite has some of my favorite UI styling on the web. Naturally, I cracked open their source hoping to learn something. What I found: React components rendering
<div>s inside<div>s, with piles of JavaScript doing what<dialog>does for free.So I borrowed their visual design and rebuilt it with semantic HTML and CSS using affordance classes. I want to walk you through all of the choices I’ve made and how it all comes together.
Continue reading … -
Confirmation dialogs with zero JavaScript
Turbo’s
data-turbo-confirmattribute is convenient for quick confirmation dialogs, but the nativeconfirm()prompt it triggers looks dated and out of place. If you want a styled confirmation dialog that matches your app’s design, the traditional approach recommends a lot of JavaScript—a Stimulus controller to open and close the dialog, event listeners for keyboard handling, and coordination between the trigger and the modal.But, recent browser updates have changed the game. Invoker Commands landed in Chrome 131 and Safari 18.4, giving us declarative dialog control. Combined with
Continue reading …@starting-stylefor animations, we can now build beautiful, animated confirmation dialogs without writing any JavaScript. -
Affordances: The Missing Layer in Frontend Architecture
I was building a form with a file input. Nothing fancy—just a place for users to upload a document. I wanted the trigger to look like the other buttons on the page: the same subtle shadows, the same hover effects, the same spacing. I was using Catalyst, the component kit from Tailwind Labs, so I had a
Continue reading …<Button>component with all those styles baked in. -
CSS-only Star Rating Component with Half Steps
After some experimentation, research, and AI being stupid, I finally have a simple, clean implementation of a star rating component that uses only radio inputs and labels and allows for half steps. 50 lines of beautiful CSS. Let’s break it down piece by piece.
Continue reading … -
Writing Tailwind Compatible Semantic Css
Continue reading … -
Always use
flex-wrap: wrapon flex containersI spent a bit of time this morning make some improvements to sqlite.directory, and I found myself needing to make a number of fixes around the mobile responsiveness of the UI. So, I thought I would take a moment to catalog a few common patterns and tips I have found useful when working with responsive design. This first tip was one that I found myself using quite a bit today.
Continue reading … -
Slideover Bootstrap Modals
Sometimes we don’t want a modal floating in the center of the viewport; sometimes, we want a full-height modal that slides into frame. Luckily, we can write a bit of CSS to extend the Bootstrap
Continue reading …modalcomponent to support slideover modals. -
Building Pure CSS Trees (part 5)
After the first 4 parts of our series, we have some flexible (S)CSS that will render nested lists as trees. It can render horizontal trees, vertical trees, trees going from top-to-bottom or bottom-to-top, left-to-right or right-to-left , and even bracket-style centered trees.
Continue reading … -
Building Pure CSS Trees (part 4)
The last we left our pure-CSS tree component, it could render both horizontally oriented as well as vertically oriented as well as the inverse direction for either. With each orientation now capable of being rendered in either direction, might we be able to build a tree component that could put the root node in the center of the graph and have half of the descendant graph render to left and have to the right (for the horizontal orientation) or half to the top and half to the bottom (for the vertical orientation)?
Continue reading … -
Building Pure CSS Trees (part 3)
The last we left our pure-CSS tree component, it could render both horizontally oriented as well as vertically oriented; however, each orientation only worked in one direction—the horizontal tree only rendered left-to-right and the vertical tree only rendered top-to-bottom. What if we wanted to render trees in the inverse orientations?
Continue reading …