X Stats

Login Sign Up
@fractaledmind

Stephen Margheim

@fractaledmind

699 Tweets
1,303 Following
4,462 Followers

Modern CSS • Web Platform APIs • Rails + SQLite

Date ↓ Tweet ❤️ 🔄 💬 👁 📝
Jan 03 A hot take after seeing yet another fancy tabs design: the classic "tab component" is over-engineered for 90% of use cases. You probably don't need it... 29 1 4 10.8k 155 .
Jan 01 Component libraries bundle JS behavior, CSS styling, and DOM templating. Most of the time I just want one, not all three. Headless libraries solved "behaviors only, no styles." I can't find any "bodiless" libraries offering styles only, no behaviors. So I'm making HTML UI... https://t.co/tfmrbd1Avj 566 24 17 71.1k 301 .
Jan 01 Stop using rating libraries. I've created a CSS-only star rating component with half-star support in just 60 lines. No JavaScript. Fully accessible. Smooth hover interactions. Here’s how it works: 🧵 https://t.co/IpihwCN6IE 283 10 11 30.1k 223 .
Dec 31 Stop using <select multiple> for "select many" UI. It's the worst form control in HTML. Luckily, there is a better pattern, and it isn't difficult or weird... https://t.co/GN6Sg9vYgd 381 11 14 64k 188 .
Dec 30 Plain HTML and CSS can be beautiful. Stay tuned 👀 https://t.co/85p6xEK5K0 670 26 24 39.6k 74 .
Dec 29 CSS cascade layers are the most underrated feature of modern CSS. They're why semantic classes work now when they failed before. Here's the 2-minute explanation: 178 8 6 35.3k 162 .
Dec 27 When you simply need to have a link look like a button, pretty pretty please do this instead 🙏 https://t.co/BKUYvjONPB 292 7 4 27k 118 .
Dec 27 Yesterday I showed how to build horizontal tree structures with just plain HTML and CSS. Today: vertical trees (org charts, family trees, decision diagrams). And the lovely detail is that it only takes one key change to make it all work: 🧵 https://t.co/NvA6SFiJ8P 176 7 3 21.4k 265 .
Dec 27 Polymorphic components are a code smell that there is a missing layer in our stack. We need to revive well named classes, but with the wisdom gained from the utility-first movement: https://t.co/WcpwBA0Nm3 195 18 8 39.1k 205 .
Dec 26 Org charts, file trees, tournament brackets—all with pure CSS. No canvas. No SVG. No JS. Just flexbox and pseudo-elements. Let's break it down, starting with the foundational left-to-right tree, where only a couple dozen lines of CSS can transform this ... into this ... 🧵 https://t.co/mLsIqH08aE 201 20 5 15.5k 298 .
Dec 25 If you're going to write semantic CSS classes in 2025, don't call them .btn or .card. Use a ui-* prefix: ui-button, ui-input, ui-badge. Here's why naming matters more than you think... 85 1 14 17.6k 186 .
Dec 24 Your app/design system needs a .button class before it needs a <Button/> component. We need to be able to compose behaviors and appearance as needed. A <label> might need to look like a button, or <summary>, or <input type=radio> Visual affordances deserve their own primitive. 101 3 12 15k 303 .
Dec 22 The web platform has supported keyboard shortcuts for over a decade! Say hello to criminally overlooked `accesskey` attribute. Add it to an interactive element like a button, link, or input so users can fire its default action via keyboard shortcut, no JS required! https://t.co/mM6mA4ZY33 292 19 8 16.5k 290 .
Dec 20 `popover` & `popovertarget` give you dropdown menus w/ light-dismiss for free. <button popovertarget="menu">Options</button> <nav id="menu" popover> <ul> <li><a href="/settings">Settings</a></li> <li><a href="/profile">Profile</a></li> </ul> </nav> #StylishHTML https://t.co/8GMeU4o41u 220 15 6 11.6k 388 .
Dec 19 Breadcrumb separators belong in CSS, not HTML. Just use the `::after` pseudo-element. nav > ol > li:not(:last-child)::after { content: " / "; color: lightgray; padding: 0 0.5em; } The `:not(:last-child)` ensures no trailing separator after the final item. #StylishHTML https://t.co/BNdez46uac 608 38 13 22.9k 307 .
Dec 18 I think @trycampsite had some of the most elegant UI on the web, especially for modal dialogs, but it was all React components rendering <div>s inside <div>s. So I stole their design and rebuilt it with semantic HTML and CSS. 😅 https://t.co/54apoduCpi https://t.co/ecyq7LQYxh 151 5 8 19.5k 289 .
Dec 16 The Tailwind community has become too dogmatic about utility-only. Tailwind is utility-FIRST, not utility-ONLY. And @​utility and @​apply are criminally underused. And here is why this matters... 151 7 13 19.4k 196 .
Dec 14 I cloned @laravelphp's Cloud breadcrumbs as a simple 137 5 9 10.7k 283 .
Dec 13 To master exit transitions for <dialog>s, turn to `transition-behavior: allow-discrete`. Most CSS transitions are smooth, but `display` toggles abruptly. `allow-discrete` ensures elements stay visible briefly for smoother exits before `display: none`. https://t.co/RQ7p1cW3BH 419 43 4 15.7k 281 .
Dec 08 s with forms have a simple HTML-only way to implement "Cancel" buttons. In addition to POST and GET,
s inside of s can make use of the DIALOG `method`. This allows the submit button to close the dialog without submitting the form to the backend. #StylishHTML
139 7 2 10.4k 281 .
Sep 04 My favorite upcoming feature coming to the Rails ecosystem is ActiveRecord::Tenanted, which is an exciting new gem coming from @flavorjones soon. Everyone gets a database! https://t.co/kqd4SB2iYt 173 17 13 54.3k 196 .
Feb 19 🚀 High Leverage Rails is available now! Simplify your stack and scale from zero to IPO with Rails + SQLite. I made this video course in partnership with Try Hard Studios to teach you everything you need (and nothing you don't) to build then ship quality apps with less hassle. https://t.co/GM1S1UMvBW 150 31 7 10.8k 300 .
Jan 24 If you didn't see yesterday, I'm partnering with @aarondfrancis and @steve_tenuto to produce an in-depth video course on building with Rails + SQLite. "High Leverage Rails" is coming in February and I couldn't be more excited! https://t.co/S6eHAgStjG 112 7 3 19.1k 250 .
Nov 19 If you thought JSON columns in your PG tables were cool, just imagine the power of SQLite columns in your tables 🤯🤯 This new PG extension lets you stores the raw bytes of a SQLite db in a column then use the SQLite engine to work with it. https://t.co/OuUx7gpUUw 368 51 25 37.8k 265 .
Oct 18 SQLite needs fine-tuning, but with Rails 8, the Rails framework now does *all* of the configuration and usage tuning for you, invisibly. This is the culmination of over a year of effort from myself and the community at large, and I could not be more proud or excited! https://t.co/ZjgLWSLbzj 131 9 2 10.3k 291 .
Oct 16 Or, if you prefer, I have my slides and speaker notes stitched together as a blog post as well: https://t.co/Fi26z2Lmc5 26 1 0 39.5k 119 .
Oct 16 Rails is reaching new heights as the One Person Framework, supercharged by the power and simplicity of SQLite. If you’ve ever been curious about why and how Rails 8 and SQLite work so magically together, my #RailsWorld talk is now up. Check it out! https://t.co/lGcZ5xhCvo 133 8 6 14.1k 273 .
Sep 26 DHH shouts out @pezza_n for his work on Solid Cable in his #RailsWorld keynote! Look at those perf numbers. https://t.co/SG1HWr2Bp6 180 9 4 23.6k 131 .