Skip to main content
CSS-Tricks
  • Articles
  • Notes
  • Links
  • Guides
  • Almanac
  • Picks
  • Shuffle
Search

Articles Tagged
custom properties

93 Articles
interface designed to appear like an elevator button panel, with four buttons labelled 1, 2, 3, 4, on the left side is a block containing an arrow pointing up as the direction the elevator is traveling
Direct link to the article CSS Elevator: A Pure CSS State Machine With Floor Navigation
animation custom properties forms

CSS Elevator: A Pure CSS State Machine With Floor Navigation

In this article, author Chris Sabourin walk through how modern CSS features can build a fully functional, interactive elevator that knows where it is, where it’s headed, and how long it’ll take to get there. No JavaScript required.
Christian Sabourin on Aug 29, 2025
Direct link to the article 3D Layered Text: Interactivity and Dynamicism
animation background custom properties

3D Layered Text: Interactivity and Dynamicism

In this third and final chapter, we’re stepping into interactivity by adding JavaScript, starting with a simple :hover effect, and ending with a fully responsive bulging text that follows your mouse in real time.
Amit Sheen on Aug 22, 2025
Direct link to the article Maybe don’t use custom properties in shorthand properties
cascade custom properties

Maybe don’t use custom properties in shorthand properties

This easily qualifies as a "gotcha" in CSS and is a good reminder that the cascade doesn't know everything all at the same time. If a custom property is invalid, the cascade won't ignore it, and it gets evaluated, which invalidates the declaration.
Geoff Graham on Mar 6, 2025
Direct link to the article Calculate Viewport Size in CSS
custom properties functions viewport units

Calculate Viewport Size in CSS

A way to calculate the viewport’s width and height without JavaScript, by way of Temani Afif over at CSS Tip:

@property --_w {
  syntax: '<length';
  inherits: true;
  initial-value: 100vw; 
}
@property --_h {
  syntax: '<length';
  inherits: true;
  
…
Geoff Graham on Jul 17, 2024
Direct link to the article “If” CSS Gets Inline Conditionals
custom properties selectors

“If” CSS Gets Inline Conditionals

A few sirens went off a couple of weeks ago when the CSS Working Group (CSSWG) resolved to add an if() conditional to the CSS Values Module Level 5 specification. It was Lea Verou’s X post that same day that …

Geoff Graham on Jul 19, 2024
Direct link to the article How I Made an Icon System Out of CSS Custom Properties
custom properties Sass SVG svg icons

How I Made an Icon System Out of CSS Custom Properties

SVG is the best format for icons on a website, there is no doubt about that. It allows you to have sharp icons no matter the screen pixel density, you can change the styles of the SVG on hover …

Louis Hoebregts on Sep 28, 2022
Direct link to the article Making a Real-Time Clock With a Conic Gradient Face
conic gradients custom properties dates gradients

Making a Real-Time Clock With a Conic Gradient Face

Gradients have been a part of the CSS spectrum for quite some time now. We see a lot of radial and linear gradients in a lot of projects, but there is one type of gradient that seems to be a …

Brecht De Ruyte on Sep 19, 2022
Direct link to the article Interpolating Numeric CSS Variables
@property animation custom properties

Interpolating Numeric CSS Variables

We can make variables in CSS pretty easily:

:root {
  --scale: 1;
}

And we can declare them on any element:…

Geoff Graham on Sep 1, 2022
Direct link to the article Multi-Value CSS Properties With Optional Custom Property Values
custom properties

Multi-Value CSS Properties With Optional Custom Property Values

Imagine you have an element with a multi-value CSS property, such as transform: optional custom property values:

.el {
  transform: translate(100px) scale(1.5) skew(5deg);
}

Now imagine you don’t always want all the transform values to be applied, so some …

Yair Even Or on Feb 14, 2022
  • 1
  • 2
  • 3
  • ...
  • 11
  • Older

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • About DO
  • Cloudways
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Contact
  • Write for CSS-Tricks!
  • Advertise with us
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • Bluesky
Back to Top