Blog
Practical CSS & UI tutorials, every guide pairs with a free visual tool on uitweak.
Detect When position: sticky Is Stuck: css scroll-state Queries, No JavaScript (2026)
css scroll-state queries detect when position: sticky is stuck in pure CSS. Copy-paste recipes for the stuck header shadow, snapped states, and a JS fallback for Safari.
Tooltips That Never Clip: CSS Anchor Positioning Recipes (2026)
Fix tooltips clipped inside overflow:hidden with CSS anchor positioning: anchor-name basics, position-try flip recipes, popover pairing, and an @supports fallback.
CSS Masonry Is Finally Real: grid-lanes (Your Old Syntax Is Stale)
grid-template-rows: masonry is dead syntax. Learn the final display: grid-lanes CSS masonry layout: browser support, flow-tolerance tab-order fixes, and @supports fallbacks.
z-index: 99999 Not Working? Your Modal Is Trapped: Escape to the Top Layer
Fix modals rendering behind headers and overlays even with z-index: 99999. Diagnose the stacking-context trap with DevTools, then escape it three ways: dialog showModal, the popover API, and React portals. With copy-paste code.
Hover Stuck on Mobile After Tap? The (hover: hover) Media Query Fix
Fix sticky hover states on touch devices: why taps fake a hover that never leaves, the @media (hover: hover) and (pointer: fine) gate, :active press feedback, and tap-highlight cleanup. With copy-paste code.
Stop the Red Borders on Page Load: :user-valid / :user-invalid
Fix form validation that yells at users before they type: :user-invalid and :user-valid style fields only after interaction, no JS touched-state needed. Recipes, the :has() wrapper trick, and fallbacks. With copy-paste code.
Back Button Skips Your Page Transition? View Transition Pitfalls in Next.js
Fix view transitions that work on link clicks but snap on back button, and shared-element morphs that silently never fire. The popstate truth, duplicate view-transition-name audit, and React 19.3 changes. With copy-paste code.
Do You Still Need Sass in 2026? Native CSS Nesting vs Sass, Honestly
Native CSS nesting is Baseline. Can you drop Sass? The 4 real trip-ups, the grep-your-codebase stay-or-leave test, and an honest verdict table. With copy-paste code.
Stop Faking Trimmed Underlines: text-decoration-inset (Chrome 154)
Chrome 154 shipped text-decoration-inset: native control over where underlines start and end. Trim overshoot, animate hover reveals, and fix merged adjacent underlines, with @supports fallbacks. With copy-paste code.
Stop Hardcoding Button Text Colors: contrast-color() Picks Black or White
contrast-color() is Baseline: pass any background color and the browser returns black or white with the best contrast. Delete the luminance helper, fix unreadable CMS badges, and build theme-proof buttons. With copy-paste code.
Delete Your Auto-Resize Textarea Script: field-sizing: content
field-sizing: content is Baseline: one line of CSS grows textareas with their content. The rows attribute gotcha, lh clamps, the CSS.supports migration path, and the grid stretch trap. With copy-paste code.
Tailwind v4 Ignores Your Custom CSS? The @layer Cascade Trap Fix
Fix Tailwind v4 styles silently losing to your own CSS: why unlayered resets beat every utility, the theme/base/components/utilities layer order, and putting custom CSS in @layer so utilities win again. With copy-paste code.