Skip to main content
CSS-Tricks
  • Articles
  • Alamanac
  • Guides
  • Videos
  • Books
  • Newsletter
Search

Articles Tagged
custom properties

90 Articles
{
,

}
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 …

Avatar of Geoff Graham
Geoff Graham on Jul 9, 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 …

Avatar of Louis Hoebregts
Louis Hoebregts on Sep 22, 2022 (Updated 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 …

Avatar of Brecht De Ruyte
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:…

Avatar of Geoff Graham
Geoff Graham on Aug 30, 2022 (Updated 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 …

Avatar of Yair Even Or
Yair Even Or on Feb 11, 2022 (Updated on Feb 14, 2022)
Direct link to the article How to Make a Pure CSS 3D Package Toggle
3d css animation custom properties

How to Make a Pure CSS 3D Package Toggle

You know how you can get cardboard boxes that come totally flat? You fold ‘em up and tape ‘em to make them into a useful box. Then when it’s time to recycle them, you cut them back apart to flatten …

Avatar of Jhey Tompkins
Jhey Tompkins on Jan 12, 2022 (Updated on Jan 13, 2022)
Direct link to the article Don’t Fight the Cascade, Control It!
:is :where cascade cascade layers custom properties data attributes specificity

Don’t Fight the Cascade, Control It!

If you’re disciplined and make use of the inheritance that the CSS cascade provides, you’ll end up writing less CSS. But because our styles often comes from all kinds of sources — and can be a pain to structure and …

Avatar of Mads Stoumann
Mads Stoumann on Jan 10, 2022 (Updated on Jan 11, 2022)
Direct link to the article The surprising behavior of !important in CSS custom property values
!important custom properties

The surprising behavior of !important in CSS custom property values

Huh! I did not realize that CSS custom properties had their own resolution behavior for how !important works in their values. Uh, despite writing a guide about them. 😬 But hey it’s now updated.

Stefan Judis documents it clearly. …

Avatar of Chris Coyier
Chris Coyier on Dec 17, 2021
Direct link to the article Parallax Powered by CSS Custom Properties
animation custom properties GSAP

Parallax Powered by CSS Custom Properties

Good friend Kent C. Dodds has recently dropped his new website which had a lot of work go into it. I was fortunate enough that Kent reached out a while back and asked if I could come up with some …

Avatar of Jhey Tompkins
Jhey Tompkins on Nov 19, 2021
Direct link to the article Different Degrees of Custom Property Usage
custom properties design systems

Different Degrees of Custom Property Usage

One way to work with Custom Properties is to think of them as design tokens. Colors, spacings, fonts, and whatnot. You set them at the root of the page and use them throughout your CSS. Very useful, and the classic …

Avatar of Chris Coyier
Chris Coyier on Oct 14, 2021
Direct link to the article The Big Gotcha With Custom Properties
custom properties

The Big Gotcha With Custom Properties

I’ve seen this confuse more than a handful of people recently, including myself, so I’m making sure it’s written down.…

Avatar of Chris Coyier
Chris Coyier on Aug 19, 2021
  • 1
  • 2
  • 3
  • ...
  • 9
  • Older

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

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