Home/CSS-Tricks
Source

CSS-Tricks

1,207 articles from CSS-Tricks.

Frontend — SMIL on?

SMIL on?

Well, it turns out that SVG's built-in animation features were never deprecated as planned. Sure, CSS and JavaScript are more than capable of carrying the load, but it's good to know that SMIL is not dead in the water as previously thought, and is actually well-supported.

GGGeoff GrahamGeoff Graham·April 2, 2025Frontend
Frontend — Crafting Strong DX With Astro Components and TypeScript

Crafting Strong DX With Astro Components and TypeScript

One thing we can do to help teams code consistently is provide type-checking so that all of the configurable options for a specific component are available while coding. Bryan demonstrates how he does this with TypeScript when working with Astro components.

BRBryan RobinsonBryan Robinson·April 1, 2025Frontend
Frontend — Worlds Collide: Keyframe Collision Detection Using Style Queries

Worlds Collide: Keyframe Collision Detection Using Style Queries

Interactive CSS animations with elements ricocheting off each other seem more plausible in 2025. While it’s unnecessary to implement Pong in CSS, the increasing flexibility and power of CSS reinforce Lee's suspicion that one day it will be a lifestyle choice whether to achieve any given effect with scripting or CSS.

LMLee MeyerLee Meyer·March 31, 2025Frontend
Frontend — Revisiting CSS border-image

Revisiting CSS border-image

I’ve used border-image regularly. Yet, it remains one of the most underused CSS tools, and I can’t, for the life of me, figure out why. Is it possible that people steer clear of border-image because its syntax is awkward and unintuitive? Perhaps it’s because most explanations don’t solve the type of creative implementation problems that most people need to solve. Most likely, it’s both.

ACAndy ClarkeAndy Clarke·March 21, 2025Frontend
Engineering — Quick Hit #41

Quick Hit #41

Ooo, look at that: Safari Technology Preview 215 adds support for scroll-driven animations, anchor positioning, and text-wrap: pretty. That's a good sign that

GGGeoff GrahamGeoff Graham·March 19, 2025Engineering
Engineering — Web Components Demystified

Web Components Demystified

Scott Jehl released a course called Web Components Demystified. This is my full set of notes from Scott's course. You'll still want to take the course on your own, and I encourage you to because Scott is an excellent teacher who makes all of this stuff extremely accessible, even to noobs like me.

GGGeoff GrahamGeoff Graham·March 14, 2025Engineering
Engineering — Quick Hit #39

Quick Hit #39

The CSSWG has voted to add a size keyword that's shorthand for the width and height properties.

GGGeoff GrahamGeoff Graham·March 14, 2025Engineering
Design & UX — Smashing Meets Accessibility

Smashing Meets Accessibility

The videos from Smashing Magazine's recent event on accessibility were just posted the other day. I was invited to host the panel discussion with the speakers, including a couple of personal heroes of mine, Stéphanie Walter and Sarah Fossheim. But I was just as stoked to meet Kardo Ayoub who shared his deeply personal story as a designer with a major visual impairment.

GGGeoff GrahamGeoff Graham·March 10, 2025Design & UX
Frontend — Quick Hit #38

Quick Hit #38

Chrome has delayed shipping @function to Chrome 139! A wise choice, if you ask me; functions will set a before and after in CSS.

JDJuan Diego RodríguezJuan Diego Rodríguez·March 9, 2025Frontend
Frontend — A CSS-Only Star Rating Component and More! (Part 2)

A CSS-Only Star Rating Component and More! (Part 2)

In this second article of a two-part series, Temani Afif demonstrates an alternative approach to creating the star rating component from the first article using experimental scroll-driven animations rather than using the border-image property.

TATemani AfifTemani Afif·March 7, 2025Frontend
Frontend — Quick Hit #37

Quick Hit #37

The very first public draft of the CSS Form Control Styling Module Level 1 specification has been published as of yesterday. Still a work-in-progress but what

GGGeoff GrahamGeoff Graham·March 6, 2025Frontend
Frontend — Handwriting an SVG Heart, With Our Hearts

Handwriting an SVG Heart, With Our Hearts

A while back on CSS-Tricks, we shared several ways to draw hearts, and the response was dreamy. Now, to show my love, I wanted to do something personal, something crafty, something with a mild amount of effort.

RTRyan TrimbleRyan Trimble·February 14, 2025Frontend
Frontend — Scroll Driven Animations Notebook

Scroll Driven Animations Notebook

Adam's such a mad scientist with CSS. He's been putting together a series of "notebooks" that make it easy for him to demo code. He's got one for gradient

GGGeoff GrahamGeoff Graham·February 13, 2025Frontend
Engineering — Make Any File a Template Using This Hidden macOS Tool

Make Any File a Template Using This Hidden macOS Tool

Stationery Pad is a handy way to nix a step in your workflow if you regularly use document templates on your Mac. The long-standing Finder feature essentially tells a file’s parent application to open a copy of it by default, ensuring that the original file remains unedited.

GGGeoff GrahamGeoff Graham·February 10, 2025Engineering
Frontend — Compiling CSS With Vite and Lightning CSS

Compiling CSS With Vite and Lightning CSS

Are partials the only thing keeping you writing CSS in Sass? With a little configuration, it's possible to compile partial CSS files without a Sass dependency. Ryan Trimble has the details.

RTRyan TrimbleRyan Trimble·February 3, 2025Frontend
Career & Teams — Chrome 133 Goodies

Chrome 133 Goodies

Did you see the release notes for Chrome 133? It's currently in beta, but the Chrome team has been publishing a slew of new articles with pretty incredible demos that are tough to ignore. I figured I'd round those up in one place.

GGGeoff GrahamGeoff Graham·January 31, 2025Career & Teams
Frontend — The Mistakes of CSS

The Mistakes of CSS

All of the things that the CSS Working Group would change if they had a time-traveling Delorean to go back and do things over.

JDJuan Diego RodríguezJuan Diego Rodríguez·January 30, 2025Frontend
Engineering — What on Earth is the `types` Descriptor in View Transitions?

What on Earth is the `types` Descriptor in View Transitions?

The @view-transition at-rule has two descriptions. One is the commonly used navigation descriptor. The second is types, the lesser-known of the two, and one that probably envies how much attention navigation gets. But read on to learn why we need types and how it opens up new possibilities for custom view transitions when navigating between pages.

JDJuan Diego RodríguezJuan Diego Rodríguez·January 29, 2025Engineering
Frontend — A CSS Wishlist for 2025

A CSS Wishlist for 2025

2024 has been one of the greatest years for CSS: cross-document view transitions, scroll-driven animations, anchor positioning, animate to height: auto, and

JDJuan Diego RodríguezJuan Diego Rodríguez·December 23, 2024Frontend
Design & UX — Smashing Meets Product Design

Smashing Meets Product Design

I had the pleasure of hosting a recent Smashing Magazine workshop on product design, subbing for Vitaly Friedman who usually runs these things.

GGGeoff GrahamGeoff Graham·December 10, 2024Design & UX
Frontend — Yet Another Anchor Positioning Quirk

Yet Another Anchor Positioning Quirk

As awesome as I think it is, CSS Anchor Positioning has a lot of quirks, some of which are the product of its novelty and others due to its unique way of working. Today, I want to bring you yet another Anchor Positioning quirk that has bugged me since I first saw it.

JDJuan Diego RodríguezJuan Diego Rodríguez·December 9, 2024Frontend
Security — WordPress Multi-Multisite: A Case Study

WordPress Multi-Multisite: A Case Study

What's it look like to create a dashboard within the WordPress admin for analyzing Google Analytics data across 900 blogs across 25 multisite instances? It involves designing a user-friendly interface, leveraging the WordPress REST API, implementing a plugin for data retrieval, and addressing challenges like rate limits and authentication.

SFScott FennellScott Fennell·November 27, 2024Security
Frontend — Solved by CSS: Donuts Scopes

Solved by CSS: Donuts Scopes

Donut scoping addresses the challenge of preventing parent styles from leaking to nested content. Originating from a 2011 concept by Nicole Sullivan, the issue has evolved, culminating in 2024's @scope at-rule. This allows for more precise CSS styling, safeguarding content from unwanted inheritance while managing global CSS complexities.

JDJuan Diego RodríguezJuan Diego Rodríguez·November 22, 2024Frontend
Frontend — Invoker Commands: Additional Ways to Work With Dialog, Popover… and More?

Invoker Commands: Additional Ways to Work With Dialog, Popover… and More?

Web browsers are experimenting with two HTML attributes — technically, they’re called “invoker commands” — that are designed to invoke popovers, dialogs, and further down the line, all kinds of actions without writing JavaScript. Although, if you do reach for JavaScript, the new attributes come with some new events that we can listen for.

DSDaniel SchwarzDaniel Schwarz·November 20, 2024Frontend
Frontend — Complete CSS Course

Complete CSS Course

Do you subscribe to Piccalilli? You should. If you're reading that name for the first time, that would be none other than Andy Bell running the ship and he's reimagined the site from the ground-up after coming out of hibernation this year. You're likely familiar with Andy's great writing here on CSS-Tricks.

GGGeoff GrahamGeoff Graham·November 19, 2024Frontend
Engineering — Quick Hit #30

Quick Hit #30

"Waits are a price that developers ask users to pay and loading spinners only buy so much time." —Alex Russell (permalink)

GGGeoff GrahamGeoff Graham·November 18, 2024Engineering
Frontend — Quick Hit #29

Quick Hit #29

I'm interviewing Alex Russell tomorrow for Smashing Magazine — it's free so come and join the chat as we discuss the expensive JavaScript, browser choice, app

GGGeoff GrahamGeoff Graham·November 18, 2024Frontend
Frontend — Anchoreum: A New Game for Learning Anchor Positioning

Anchoreum: A New Game for Learning Anchor Positioning

You've played Flexbox Froggy before, right? Or maybe Grid Garden? They're both absolute musts for learning the basics of modern CSS layout using Flexbox and CSS Grid. Thomas Park made those and he's back with another game: Anchoreum.

GGGeoff GrahamGeoff Graham·November 12, 2024Frontend
Engineering — Tim Brown: Flexible Typesetting is now yours, for free

Tim Brown: Flexible Typesetting is now yours, for free

Another title from A Book Apart has been re-released for free. The latest? Tim Brown's Flexible Typesetting. I may not be the utmost expert on typography and its best practices but I do remember reading this book (it's still on the shelf next to me!) thinking maybe, just maybe, I might be able to hold a conversation about it with Robin when I finished it.

GGGeoff GrahamGeoff Graham·November 11, 2024Engineering
Engineering — Quick Hit #28

Quick Hit #28

I like how I'm hearing animations distinguished as "time-based animations" (or TBA) and "scroll-driven animations" (or SDA). A third? Maybe "navigation-based

GGGeoff GrahamGeoff Graham·November 8, 2024Engineering
Frontend — State of CSS 2024 Results

State of CSS 2024 Results

The results from this year's survey are fairly fresh off the presses. We took a little time to sit with them and jot down some things we noticed and found interesting.

GGGeoff GrahamGeoff Graham·October 30, 2024Frontend
Design & UX — Tooltip Best Practices

Tooltip Best Practices

What are tooltips, exactly? There's two kinds and the one you use has implications on the user experience, as Zell illustrates in this explainer on best practices.

ZLZell LiewZell Liew·October 29, 2024Design & UX
Frontend — You can use text-wrap: balance; on icons

You can use text-wrap: balance; on icons

The CSS text-wrap property is (rightfully) widely assumed to be used strictly for text elements. But Terrence Eden posted an article on his blog that shows how it can also be used to balance the way other types of elements wrap, including icons.

GGGeoff GrahamGeoff Graham·October 24, 2024Frontend
Engineering — Combining forces, GSAP & Webflow!

Combining forces, GSAP & Webflow!

Change can certainly be scary whenever a beloved, independent software library becomes a part of a larger organization. I'm feeling a bit more excitement than

RTRyan TrimbleRyan Trimble·October 18, 2024Engineering
Engineering — Quick Hit #26

Quick Hit #26

Looks like text-wrap: pretty has landed in Safari TP! Been in Chrome since 117. Let's see if Firefox follows suit.

GGGeoff GrahamGeoff Graham·October 8, 2024Engineering
Frontend — Quick Hit #25

Quick Hit #25

Tab Atkins-Bittner left a comment in our recent notes on the CSS Masonry that thoroughly (and helpfully) counters the view that masonry would be more powerful

GGGeoff GrahamGeoff Graham·October 2, 2024Frontend
Engineering — Quick Hit #24

Quick Hit #24

Wired: "The combined weight of these legal cases threatens to crush the Internet Archive. The internet has entrusted its collective memory to this one

GGGeoff GrahamGeoff Graham·September 27, 2024Engineering
Distributed — Aggregating my distributed self

Aggregating my distributed self

Miriam Suzanne's in the middle of a redesign of her personal website. It began in August 2022. She's made an entire series out of the work that's worth your

GGGeoff GrahamGeoff Graham·September 27, 2024Distributed
Engineering — CSSWG Minutes Telecon (2024-09-18)

CSSWG Minutes Telecon (2024-09-18)

For the past two months, all my livelihood has gone towards reading, researching, understanding, writing, and editing about Anchor Positioning, and with many

JDJuan Diego RodríguezJuan Diego Rodríguez·September 20, 2024Engineering
Frontend — Quick Hit #21

Quick Hit #21

Seeing a lot more headlines decrying JavaScript and pumping up PHP. Always interesting to see which direction the front-end zeitgeist is leaning.

GGGeoff GrahamGeoff Graham·September 20, 2024Frontend
Frontend — Quick Hit #19

Quick Hit #19

Two possible syntaxes for CSS masonry, one draft specification, and you get to share your opinions.

GGGeoff GrahamGeoff Graham·September 19, 2024Frontend
Frontend — Multiple Anchors

Multiple Anchors

Only Chris, right? You'll want to view this in a Chromium browser:

GGGeoff GrahamGeoff Graham·September 16, 2024Frontend