Skip to main content
CSS is fun and cool and I like it.

A Complete Guide to calc() in CSS

CSS has a special calc() function for doing basic math. Here's an example:

.main-content {
  /* Subtract 80px from 100vh */
  height: calc(100vh - 80px);

In this guide, let's cover just about everything there is to know about this very useful function. … Read article “A Complete Guide to calc() in CSS”


How to Make a Line Chart With CSS

Line,  bar, and pie charts are the bread and butter of dashboards and are the basic components of any data visualization toolkit. Sure, you can use SVG or a JavaScript chart library like Chart.js or a complex tool like D3 to create those charts, but what if you don't want to load yet another library into your already performance-challenged website?

There are plenty of articles out there for creating CSS-only bar charts, column charts, and pie charts, but … Read article “How to Make a Line Chart With CSS”


Custom Styling Form Inputs With Modern CSS Features

It’s entirely possible to build custom checkboxes, radio buttons, and toggle switches these days, while staying semantic and accessible. We don’t even need a single line of JavaScript or extra HTML elements! It’s actually gotten easier lately than it has been in the past. Let’s take a look.… Read article “Custom Styling Form Inputs With Modern CSS Features”


The Web in 2020: Extensibility and Interoperability

In the past few years, we’ve seen a lot of change and diversion in regard to web technologies. In 2020, I foresee us as a web community heading toward two major trends/goals: extensibility and interoperability. Let’s break those down.… Read article “The Web in 2020: Extensibility and Interoperability”


Multi-Thumb Sliders: General Case

Read article “Multi-Thumb Sliders: General Case”

Multi-Thumb Sliders: Particular Two-Thumb Case

This is a concept I first came across a few years back when Lea Verou wrote an article on it. Multi-range sliders have sadly been removed from the spec since, but something else that has happened in the meanwhile is that CSS got better — and so have I, so I recently decided to make my own 2019 version.

In this two-part article, we'll go through the how, step-by-step, first building an example with two thumbs, then identify the issues … Read article “Multi-Thumb Sliders: Particular Two-Thumb Case”


7 Uses for CSS Custom Properties


Moving Rainbow Underlines

I absolutely love the design of the Sandwich site. Among many beautiful features are these headlines with rainbow underlines that move as you scroll. It's not scroll-jacking — it's just a minor design feature that uses scroll position to enact a little movement. … Read article “Moving Rainbow Underlines”


The Power (and Fun) of Scope with CSS Custom Properties

You’re probably already at least a little familiar with CSS variables. If not, here’s a two-second overview: they are really called custom properties, you set them in declaration blocks like --size: 1em and use them as values like font-size: var(--size);, they differ from preprocessor variables (e.g. they cascade), and here’s a guide with way more information.

But are we using them to their full potential? Do we fall into old habits and overlook opportunities where variables could significantly reduce … Read article “The Power (and Fun) of Scope with CSS Custom Properties”


Patterns for Practical CSS Custom Properties Use

I've been playing around with CSS Custom Properties to discover their power since browser support is finally at a place where we can use them in our production code. I’ve been using them in a number different ways and I’d love for you to get as excited about them as I am. They are so useful and powerful!

I find that CSS variables usage tends to fall into categories. Of course, you’re free to use CSS variables however you like, … Read article “Patterns for Practical CSS Custom Properties Use”