Home/CSS-Tricks
Source

CSS-Tricks

1,103 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
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 — 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
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
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
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
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
Engineering — The Value of z-index

The Value of z-index

How we look at the stacking order of our projects, how we choose z-index values, and more importantly, the implications of those choices.

ASAmit SheenAmit Sheen·March 9, 2026Engineering
Security — An Exploit ... in CSS?!

An Exploit ... in CSS?!

Read an explanation of the recent CVE-2026-2441 vulnerability that was labeled a "CSS exploit" that "allowed a remote attacker to execute arbitrary code inside a sandbox via a crafted HTML page."

LMLee MeyerLee Meyer·February 25, 2026Security
Frontend — A Complete Guide to Bookmarklets

A Complete Guide to Bookmarklets

Browsers don't just let you bookmark web pages. You can also bookmark JavaScript, allowing you to do so much more than merely save pages.

DCDeclan ChidlowDeclan Chidlow·February 25, 2026Frontend
Frontend — What’s !important #5: Lazy-loading iframes, Repeating corner-shape Backgrounds, and More

What’s !important #5: Lazy-loading iframes, Repeating corner-shape Backgrounds, and More

This issue of What’s !important is dedicated to our friends in the UK, who are currently experiencing a very miserable 43-day rain streak. Presenting: the five most interesting things to read about CSS from the last couple of weeks. Plus, the latest features from Chrome 145, and anything else you might’ve missed. TL;DR: lots of content, but also lots of rain.

DSDaniel SchwarzDaniel Schwarz·February 13, 2026Frontend
Frontend — Making a Responsive Pyramidal Grid With Modern CSS

Making a Responsive Pyramidal Grid With Modern CSS

This is the second part of a small two-part series. In this article, we will explore another type of grid: a pyramidal one. We are still working with hexagon shapes, but a different organization of the elements., while exploring other different shapes.

TATemani AfifTemani Afif·February 12, 2026Frontend
Frontend — ReliCSS

ReliCSS

Stu Robson's ReliCSS (clever name!) tool can excavate outdated CSS in your codebase that have modern CSS solutions.

GGGeoff GrahamGeoff Graham·January 28, 2026Frontend
Engineering — Open Props @custom-media Recipes

Open Props @custom-media Recipes

The @custom-media at-rule has landed in Firefox Nightly! I couldn't find it in the release notes but Adam Argyle's on the beat noting that it's behind a flag

GGGeoff GrahamGeoff Graham·January 23, 2026Engineering
Frontend — Responsive Hexagon Grid Using Modern CSS

Responsive Hexagon Grid Using Modern CSS

A while back, Temani tacked a repeating grid of hexagon shapes. Well, he's updated it with modern CSS features that result in fewer magic numbers. And it's impressive!

TATemani AfifTemani Afif·January 23, 2026Frontend
Networking — HTTP Archive 2025 Web Almanac

HTTP Archive 2025 Web Almanac

I love me some good web research reports. I'm a sucker for them. HTTP Archive's Web Almanac is one report I look forward to every year, and I know I'm not

GGGeoff GrahamGeoff Graham·January 16, 2026Networking
Frontend — "I Heart CSS" DailyDev Squad

"I Heart CSS" DailyDev Squad

If you're reading this, chances are you already have some sort of way that you're following when we publish new content, whether that's RSS, Bluesky,

GGGeoff GrahamGeoff Graham·January 16, 2026Frontend
Engineering — What’s !important #3: Popover Context Menus, @scope, New Web Platform Features, and More

What’s !important #3: Popover Context Menus, @scope, New Web Platform Features, and More

The developer community hasn’t wasted any time kicking off 2026 with some really great articles, demos, and insights. Firefox 147 and Chrome 144 also shipped, and while they’re not jam-packed with features, the releases are still pretty exciting for what’s normally a slow time of year, so without further ado, here’s what’s important from the last couple of weeks (or should I say the first couple o

DSDaniel SchwarzDaniel Schwarz·January 15, 2026Engineering
Frontend — Thank You (2025 Edition)

Thank You (2025 Edition)

This is the best job I've had in my life and it's only possible because you keep showing up each day to read, learn, share, and discuss all-things-front-end (and a little CSS, of course) with us.

GGGeoff GrahamGeoff Graham·December 23, 2025Frontend
Engineering — Toon Title Text Generator

Toon Title Text Generator

Andy Clarke with a brand-new resource. It generates the sort of fun typography that Andy commonly uses in his own work that's geared towards cartoon headings.

GGGeoff GrahamGeoff Graham·December 15, 2025Engineering
Languages — What Else Could Container Queries... Query?

What Else Could Container Queries... Query?

How far can we really go with container queries? There are dozens of media queries now, so what if there were dozens of container queries as well? What could we use them for?

DSDaniel SchwarzDaniel Schwarz·December 12, 2025Languages
Engineering — Getting Creative With “The Measure”

Getting Creative With “The Measure”

A good measure makes reading text comfortable, while a bad one makes it more difficult. So, rather than allowing layout to dictate the measure, doesn’t it make more sense for the measure to inform layout decisions?

ACAndy ClarkeAndy Clarke·December 4, 2025Engineering