James McGrath

Category: CSS

8 posts in this category

A few years ago when I started using css custom properties, I would try all kinds of things with them to see what I could discover about using them. One of the things I made is this .fs-scale class...
Published on Jul 26, 2025
Reading time: 7 minutes
Initially, browsers universally applied focus styles via the :focus pseudo-class to all focusable elements, typically as a focus ring. This default user-agent style ensured every link and button...
Published on Jul 16, 2025
Reading time: 2 minutes
Recently I found a need to calculate vh and vw
Published on Sep 25, 2023
Reading time: 1 minute
I had to code a design that was like half a pie chart with text in the slices and the center of the chart was cut out in a circle like a donut. You can see it here on Squad by Mamamia. The solution I...
Published on Aug 28, 2023
Reading time: 2 minutes
Let's make a fly in animation on scroll with css custom properties and the intersection observer.
Published on Apr 24, 2022
Reading time: 5 minutes
Here's 2 ways to position the underline in text. The easiest way is to use text-underline-offset. Another way is to put the text in a <span> or <div> and use padding-bottom and border-bottom....
Published on Mar 22, 2021
Reading time: 1 minute
As far as I know, there wasn't any way to dynamically change the CSS properties of pseudo-elements. Now that CSS custom properties are supported in the latest browsers, there are two ways in which...
Published on Feb 02, 2020
Reading time: 1 minute
I enjoy the challenge of making single div things using just CSS to make it. Over the past few years I made a few country flags.
Published on Sep 28, 2019
Reading time: 1 minute