Scott Jehl released a course called Web Components Demystified. I love that name because it says what the course is about right on the tin: you’ re going to learn about web components and clear up any confusion you may already have about them. And there’ s plenty of confusion…
CSS Tricks
Powering Search With Astro Actions and Fuse.js
Static sites are wonderful. I’m a big fan. They also have their issues. Namely, static sites either are purely static or the frameworks that generate them completely lose out on true static generation when you just dip your toes in the direction of server routes. Astro has been…
A CSS-Only Star Rating Component and More! (Part 2)
In the last article, we created a CSS-only star rating component using the CSS mask and border-image properties, as well as the newly enhanced attr() function. We ended with CSS code that we can easily adjust to create component variations, including a heart rating and volume control. This…
Functions in CSS?!
A much-needed disclaimer: You (kinda) can use functions now! I know, it isn’ t the most pleasant feeling to finish reading about a new feature just for the author to say “ And we’ ll hopefully see it in a couple of years” . Luckily, right now you can use an (incomplete)…
A CSS-Only Star Rating Component and More! (Part 1)
Creating a star rating component is a classic exercise in web development. It has been done and re-done many times using different techniques. We usually need a small amount of JavaScript to pull it together, but what about a CSS-only implementation? Yes, it is possible! Here is a…
Using & Styling the Details Element
You can find the < details> element all over the web these days. We were excited about it when it first dropped and toyed with using it as a menu back in 2019 (but probably don’ t) among many other experiments. John Rhea made an entire game that combines < details> …
Toe Dipping Into View Transitions
I’ ll be honest and say that the View Transition API intimidates me more than a smidge. There are plenty of tutorials with the most impressive demos showing how we can animate the transition between two pages, and they usually start with the simplest of all examples. @view-transition {…
The What If Machine: Bringing the “Iffy” Future of CSS into the Present
Geoff’s post about the CSS Working Group’s decision to work on inline conditionals inspired some drama in the comments section. Some developers are excited, but it angers others, who fear it will make the future of CSS, well, if-fy. Is this a slippery slope into a hellscape overrun…
Handwriting an SVG Heart, With Our Hearts
According to local grocery stores, it’ s the Valentine’ s Day season again, and what better way to express our love than with the symbol of love: a heart. A while back on CSS-Tricks, we shared several ways to draw hearts, and the response was dreamy. Check out all these…
Typecasting and Viewport Transitions in CSS With tan(atan2())
We’ ve been able to get the length of the viewport in CSS since… checks notes… 2013! Surprisingly, that was more than a decade ago. Getting the viewport width is as easy these days as easy as writing 100vw, but what does that translate to, say, in pixels? What about the other…
Make Any File a Template Using This Hidden macOS Tool
From MacRumors: 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…
Container query units: cqi and cqb
A little gem from Kevin Powell’ s “ HTML & CSS Tip of the Week” website, reminding us that using container queries opens up container query units for sizing things based on the size of the queried container. cqi and cqb are similar to vw and vh, but instead of caring about the viewport, they care…
Baseline Status in a WordPress Block
Compiling CSS With Vite and Lightning CSS
Suppose you follow CSS feature development as closely as we do here at CSS-Tricks. In that case, you may be like me and eager to use many of these amazing tools but find browser support sometimes lagging behind what might be considered “ modern” CSS (whatever that means). Even…
Revisiting CSS Multi-Column Layout
Honestly, it’s difficult for me to come to terms with, but almost 20 years have passed since I wrote my first book, Transcending CSS. In it, I explained how and why to use what was the then-emerging Multi-Column Layout module. Hint: I published an updated version, Transcending CSS…
Creating a “Starred” Feed
Chris wrote about “ Likes” pages a long while back. The idea is rather simple: “ Like” an item in your RSS reader and display it in a feed of other liked items. The little example Chris made is still really good. CodePen Embed Fallback There were two things Chris…
A Few Ways That Cloudways Makes Running This Site a Little Easier
(This is a sponsored post.) It’s probably no surprise to you that CSS-Tricks is (proudly) hosted on Cloudways, DigitalOcean’s managed hosting arm. Given both CSS-Tricks and Cloudways are part of DigitalOcean, it was just a matter of time before we’d come together this way. And here we are!…
Thank You (2024 Edition)
I’ ll be honest: writing this post feels like a chore some years. Rounding up and reflecting on what’ s happened throughout the year is somewhat obligatory for a site like this, especially when it’ s a tradition that goes back as far as 2007. “ Hey, look at all the cool…
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 many others. It seems out of touch to ask, but what else do we want from CSS? Well, many things! We put our heads together and…
The Little Triangle in the Tooltip
Tooltips are like homemade food: everyone uses them and everyone has their own recipe to make them. If you don’ t remember a particular recipe, you will search for one, follow it, and go on with your day. This “ many ways to do the same thing” concept is general…