Home/CSS-Tricks
Source

CSS-Tricks

1,207 articles from CSS-Tricks.

Frontend — Let’s Use the Emergent CSS random() Function in all the Browsers

Let’s Use the Emergent CSS random() Function in all the Browsers

The journey to create a polyfill for the upcoming CSS random() function that works in all browsers. Let’s Use the Emergent CSS random() Function in all the Browsers originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.

LMLee MeyerLee Meyer·August 31, 2026Frontend
Frontend — What’s !important #18: , Syntax ::highlight()ing, named-feature(), and More

What’s !important #18: , Syntax ::highlight()ing, named-feature(), and More

Well, that’s a wrap. No, not a flex-wrap, but rather today marks a new day, week, month, season, aaaand new edition of What’s important (#18), bringing you the best content that developers have produced over the last couple of weeks or so. What’s !important #18: <geolocation>, Syntax ::highlight()ing, named-feature(), and More originally handwritten and published with love on CSS-Tricks . You shou

DSDaniel SchwarzDaniel Schwarz·August 31, 2026Frontend
Frontend — Creating Web Widgets Using the Document Picture-in-Picture API

Creating Web Widgets Using the Document Picture-in-Picture API

The general idea is that we create a Document Picture-in-Picture window (DPIP window), and then we put HTML, CSS, and JavaScript into it. Creating Web Widgets Using the Document Picture-in-Picture API originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.

DSDaniel SchwarzDaniel Schwarz·August 27, 2026Frontend
Frontend — animation-trigger

animation-trigger

The CSS animation-trigger property allows you to delay the start of a CSS animation until a specific trigger occurs. animation-trigger originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.

SMSaleh MubasharSaleh Mubashar·August 26, 2026Frontend
Frontend — MicroLighter: Syntax Highlighter

MicroLighter: Syntax Highlighter

Syntax highlighting for code blocks without the complicated markup, spans, classes, and bloated JavaScript, courtesy of Uncle Dave. MicroLighter: Syntax Highlighter originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.

GGGeoff GrahamGeoff Graham·August 25, 2026Frontend
Frontend — WordPress PHP-Only Block Registration

WordPress PHP-Only Block Registration

Seven and half years after blocks arrived in Core, WordPress introduces a way to build blocks without React annd build pipelines. All you need is PHP. WordPress PHP-Only Block Registration originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.

FKFränk KleinFränk Klein·August 24, 2026Frontend
Frontend — Resolved: CSS Class Prefix Selector

Resolved: CSS Class Prefix Selector

A newly resolved proposal would allow us to select classes that are a prefix for variations with a wildcard, like .prefix-* . Resolved: CSS Class Prefix Selector originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.

GGGeoff GrahamGeoff Graham·August 21, 2026Frontend
Frontend — CSS Navigation Matching, Early Days

CSS Navigation Matching, Early Days

Apply a style when someone navigates from one specific page to another. The idea being it'd make the sources for cross-document view transitions declarative in CSS rather than managing that stuff in JavaScript. CSS Navigation Matching, Early Days originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.

GGGeoff GrahamGeoff Graham·August 19, 2026Frontend
Frontend — WordPress.com Student Plan

WordPress.com Student Plan

As someone who teaches beginning web development, I find that building a WordPress site makes for a great final project. Hosting those projects has always been a roadblock though. WordPress.com Student Plan originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.

GGGeoff GrahamGeoff Graham·August 19, 2026Frontend
Frontend — Dark mode toggles: two states are enough

Dark mode toggles: two states are enough

Lea's pushing back on light/dark mode implementations that display three state options for visitors: light, dark, and system. Dark mode toggles: two states are enough originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.

GGGeoff GrahamGeoff Graham·August 17, 2026Frontend
Frontend — What’s !important #17: Custom Highlight API, CSS Navigation Matching, Fixing text-stroke, and More

What’s !important #17: Custom Highlight API, CSS Navigation Matching, Fixing text-stroke, and More

Plus, how to style skeleton UIs, how to enable diagonal scrolling, how images can overflow themselves, and yet, still more. Basically, how to do a lot of really cool (CSS) stuff. What’s !important #17: Custom Highlight API, CSS Navigation Matching, Fixing text-stroke, and More originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.

DSDaniel SchwarzDaniel Schwarz·August 14, 2026Frontend
Frontend — Blocked aria-hidden: The Warning is Right, and Every Fix You’ve Found is Wrong

Blocked aria-hidden: The Warning is Right, and Every Fix You’ve Found is Wrong

The warning is correct. And the recommended fixes you've probably seen are wrong. Here's what you can do instead to properly fix the issue. Blocked aria-hidden: The Warning is Right, and Every Fix You’ve Found is Wrong originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.

DRDurgesh Rajubhai Pawar·August 12, 2026Frontend
Frontend — Animating CSS border-image

Animating CSS border-image

Border images are an overlooked feature. One neat fact is that border image slices can run across entire borders on an element, and animating it creates beautiful effects. Animating CSS border-image originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.

PPreethiPreethi·August 10, 2026Frontend
Frontend — SmashingConf Freiburg 2026, September 7-10

SmashingConf Freiburg 2026, September 7-10

Smashing Magazine’s in-person conferences are back and returning to the wonderful city of Freiburg next month, September 7–10. SmashingConf Freiburg 2026, September 7-10 originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.

GGGeoff GrahamGeoff Graham·August 10, 2026Frontend
Frontend — Using and Styling the Dialog Element

Using and Styling the Dialog Element

There's a lot of nuance to the <dialog> element, a seemingly little piece of web architecture. I've got some notes from digging into it. Using and Styling the Dialog Element originally handwritten and published with love on CSS-Tricks . You should really get the newsletter as well.

GGGeoff GrahamGeoff Graham·August 7, 2026Frontend
Engineering — Quick Hit #162

Quick Hit #162

Safari TP 248 becomes the first to trial the no-clamp keyword for the progress() function.

DSDaniel SchwarzDaniel Schwarz·July 23, 2026Engineering
Engineering — Quick Hit #160

Quick Hit #160

Firefox 153 improves interoperability for muted and :muted, popover=hint, ::-webkit-scrollbar, and elements nested inside <select> elements.

DSDaniel SchwarzDaniel Schwarz·July 21, 2026Engineering
Networking — Quick Hit #159

Quick Hit #159

Firefox 154 (Nightly) will ship text-box, text-box-trim, and text-box-edge, making them Baseline.

DSDaniel SchwarzDaniel Schwarz·July 7, 2026Networking
Engineering — Quick Hit #158

Quick Hit #158

Safari TP 247 becomes the first to trial calc-mix(), which returns a progress point between two values.

DSDaniel SchwarzDaniel Schwarz·July 6, 2026Engineering
Engineering — Quick Hit #157

Quick Hit #157

Chrome 150 becomes the first to ship animatable zoom, flex-wrap: balance, overscroll-behavior: chain (chaining with no overscroll), named-feature(), corner

DSDaniel SchwarzDaniel Schwarz·July 3, 2026Engineering
Systems — Quick Hit #156

Quick Hit #156

Chrome 150 implements comma-separated container queries as well as <image> support for light-dark(), following Firefox support.

DSDaniel SchwarzDaniel Schwarz·July 2, 2026Systems
Engineering — Quick Hit #155

Quick Hit #155

Chrome 150 ships background-clip: border-area (supported by Safari already).

DSDaniel SchwarzDaniel Schwarz·July 1, 2026Engineering
Design & UX — Quick Hit #154

Quick Hit #154

Chrome 150 implements the AccentColor/AccentColorText system-color keywords, making them Baseline.

DSDaniel SchwarzDaniel Schwarz·June 30, 2026Design & UX
Design & UX — Quick Hit #153

Quick Hit #153

Firefox 154 (Nightly) ships progress(), advanced attr(), and a UI for <input type="time"> and <input type="datetime-local">.

DSDaniel SchwarzDaniel Schwarz·June 25, 2026Design & UX
Frontend — Quick Hit #152

Quick Hit #152

Chrome 150 (Beta) and Firefox 154 (Nightly) trial the alpha() relative color CSS function.

DSDaniel SchwarzDaniel Schwarz·June 23, 2026Frontend
Frontend — Quick Hit #151

Quick Hit #151

Safari TP 246 becomes the first to trial the alpha() relative color CSS function.

DSDaniel SchwarzDaniel Schwarz·June 19, 2026Frontend
Engineering — Quick Hit #150

Quick Hit #150

Safari TP 246 trials scroll-state queries and word-break: auto-phrase (lacks Firefox support).

DSDaniel SchwarzDaniel Schwarz·June 18, 2026Engineering
Engineering — The Siren Song of ariaNotify()

The Siren Song of ariaNotify()

There's a brand new ariaNotify() method — defined by the WAI-ARIA 1.3 Specification — that provides a means of programmatically triggering narration in a screen reader.

MMMat MarquisMat Marquis·June 17, 2026Engineering
Design & UX — Quick Hit #149

Quick Hit #149

Safari TP 246 adds support for <image> values in light-dark() and three or more values in color-mix() (lacks Chrome support).

DSDaniel SchwarzDaniel Schwarz·June 17, 2026Design & UX
Frontend — Prop For That

Prop For That

Props for That creates live props based things CSS can't normally see in the browser. Things like cursor position, progress values, certain form states, current time, scroll velocity.

GGGeoff GrahamGeoff Graham·June 16, 2026Frontend
Engineering — Quick Hit #148

Quick Hit #148

Firefox 152 implements field-sizing, which enables form controls to fit their content even as the user types, making it Baseline.

DSDaniel SchwarzDaniel Schwarz·June 16, 2026Engineering
Engineering — Quick Hit #129

Quick Hit #129

Firefox 150 shipped ariaNotify(), an alternative to ARIA live regions, but it lacks Safari support and is unreliable on macOS.

DSDaniel SchwarzDaniel Schwarz·April 29, 2026Engineering
Frontend — Quick Hit #128

Quick Hit #128

Safari TP 242 trials the more advanced version of attr() from CSS Values and Units Module Level 5.

DSDaniel SchwarzDaniel Schwarz·April 27, 2026Frontend
Design & UX — Quick Hit #127

Quick Hit #127

Firefox 150 becomes the first to implement the newest version of color-mix() that accepts more than two <color>s, and light-dark() that accepts

DSDaniel SchwarzDaniel Schwarz·April 24, 2026Design & UX
Engineering — Quick Hit #126

Quick Hit #126

Firefox 150 ships :muted and all other media-based pseudo-classes, but they lack support in Chrome.

DSDaniel SchwarzDaniel Schwarz·April 23, 2026Engineering
Engineering — Quick Hit #121

Quick Hit #121

Chrome 147 becomes the first to ship border-shape as well as the scroll range for view timelines.

DSDaniel SchwarzDaniel Schwarz·April 10, 2026Engineering
Frontend — Selecting a Date Range in CSS

Selecting a Date Range in CSS

A clever approach for selecting multiple dates on a calendar where the :nth-child()'s “n of selector” syntax does all the heavy lifting... even in the JavaScript.

PPreethiPreethi·April 9, 2026Frontend
Design & UX — Quick Hit #120

Quick Hit #120

Chrome 147 ships contrast-color() (the Color Level 5 version that only resolves to black or white), making it baseline.

DSDaniel SchwarzDaniel Schwarz·April 8, 2026Design & UX
Engineering — Alternatives to the !important Keyword

Alternatives to the !important Keyword

Cascade layers, specificity tricks, smarter ordering, and even some clever selector hacks can often replace !important with something cleaner, more predictable, and far less embarrassing to explain to your future self.

SMSaleh MubasharSaleh Mubashar·April 7, 2026Engineering
Frontend — Quick Hit #117

Quick Hit #117

Safari TP 240 becomes the first to ship the revert-rule CSS keyword, which rolls the rule back to when it didn’t have its current value.

DSDaniel SchwarzDaniel Schwarz·April 1, 2026Frontend
Design & UX — Generative UI Notes

Generative UI Notes

Looking at research and experiments that are designed to automatically generate user interfaces based on user preferences.

GGGeoff GrahamGeoff Graham·March 26, 2026Design & UX
Systems — Quick Hit #114

Quick Hit #114

Firefox 149 and Safari 26.4 now allow for querying the @container name only.

DSDaniel SchwarzDaniel Schwarz·March 25, 2026Systems
Engineering — Quick Hit #112

Quick Hit #112

Bramus notes that background-image will soon support the light-dark() function.

DSDaniel SchwarzDaniel Schwarz·March 20, 2026Engineering