Home/CSS-Tricks
Source

CSS-Tricks

2,268 articles from CSS-Tricks.

Frontend — Using CSS corner-shape For Folded Corners

Using CSS corner-shape For Folded Corners

I came across Kitty Giraudel’s folded corners technique. I’ve been on a bit of a corner-shape kick lately, so I figured that corner-shape could be used to create folded corners as well.

DSDaniel SchwarzDaniel Schwarz·May 8, 2026Frontend
Frontend — Let’s Use the Nonexistent ::nth-letter Selector Now

Let’s Use the Nonexistent ::nth-letter Selector Now

My shim might give the powers that be another reason to say native support isn't necessary, or if lots of people use my :nth-letter hack in the wild, the browser gods might recognize the need to implement it for real.

LMLee MeyerLee Meyer·April 27, 2026Frontend
Engineering — Quick Hit #125

Quick Hit #125

Firefox 150 ships revert-rule, which rolls the rule back to when it didn’t have its current value. It’ll be Baseline once Chrome 148 ships.

DSDaniel SchwarzDaniel Schwarz·April 22, 2026Engineering
Engineering — Markdown + Astro = ❤️

Markdown + Astro = ❤️

Although Astro has built-in support for Markdown via .md files, I'd argue that your Markdown experience can be enhanced with MDX.

ZLZell LiewZell Liew·April 20, 2026Engineering
Frontend — The Radio State Machine

The Radio State Machine

One of the best-known examples of CSS state management is the checkbox hack. What if we want a component to be in one of three, four, or seven modes? That is where the Radio State Machine comes in.

ASAmit SheenAmit Sheen·April 14, 2026Frontend
Frontend — Quick Hit #122

Quick Hit #122

Chrome 147 becomes the first to implement the CSSPseudoElement JavaScript interface, and allow the startViewTransition() method to be called on specific

DSDaniel SchwarzDaniel Schwarz·April 13, 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
Frontend — Making Complex CSS Shapes Using shape()

Making Complex CSS Shapes Using shape()

Creating rectangles, circles, and rounded rectangles is the basic of CSS. Creating more complex CSS shapes such as triangles, hexagons, stars, hearts, etc. is more challenging but still a simple task if we rely on modern features.

TATemani AfifTemani Afif·April 2, 2026Frontend
Design & UX — Form Automation Tips for Happier User and Clients

Form Automation Tips for Happier User and Clients

That gap between "the form works" and "the business works" is something we don't really tend to discuss much as front-enders. We focus a great deal on user experience, validation methods, and accessibility, yet we overlook what the data does once it leaves our control

INIqra Naaem·March 30, 2026Design & UX
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
Frontend — JavaScript for Everyone: Destructuring

JavaScript for Everyone: Destructuring

Mat Marquis and Andy Bell have released JavaScript for Everyone, an online course offered exclusively at Piccalilli. This post is an excerpt from the course taken specifically from a chapter all about JavaScript destructuring.

MMMat MarquisMat Marquis·March 19, 2026Frontend
Frontend — Abusing Customizable Selects

Abusing Customizable Selects

Let’s go over a few demos using the new customizable <select> feature that may be wild, but also give us a great chance to learn new things in CSS.

PBPatrick BrossetPatrick Brosset·March 11, 2026Frontend
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
Languages — Popover API or Dialog API: Which to Choose?

Popover API or Dialog API: Which to Choose?

Choosing between Popover API and Dialog API is difficult because they seem to do the same job, but they don’t! After a bit lots of research, I discovered that the Popover API and Dialog API are wildly different in terms of accessibility and we'll go over that in this article.

ZLZell LiewZell Liew·March 2, 2026Languages
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 — Interop 2026

Interop 2026

Interop 2026 is officially a thing and there's plenty of new (and even old) CSS features that we can look forward to being cross-browser compatible and consistent!

GGGeoff GrahamGeoff Graham·February 17, 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 — CSS Bar Charts Using Modern Functions

CSS Bar Charts Using Modern Functions

CSS-only bar charts are one of those things we've tackled a bunch of times in different ways. But how can modern CSS features finally make it not only trivial, but fun?

PPreethiPreethi·February 5, 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
Frontend — I Learned The First Rule of ARIA the Hard Way

I Learned The First Rule of ARIA the Hard Way

Semantic HTML does a lot more accessibility work than we usually give it credit for already — and ARIA is simple to abuse when we use it both as a shortcut and as a supplement.

HQHashim Quraishi·January 21, 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