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

Articles Tagged
custom properties

91 Articles
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. …

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 …

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 …

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

Chris Coyier on Aug 19, 2021
Direct link to the article Efficient Infinite Utility Helpers Using Inline CSS Custom Properties and calc()
custom properties mixins Sass sass maps

Efficient Infinite Utility Helpers Using Inline CSS Custom Properties and calc()

I recently wrote a very basic Sass loop that outputs several padding and margin utility classes. Nothing fancy, really, just a Sass map with 11 spacing values, looped over to create classes for both padding and margin on each side. …

Andy Ford on Aug 9, 2021
Direct link to the article Using Absolute Value, Sign, Rounding and Modulo in CSS Today
css variables custom properties functions houdini math

Using Absolute Value, Sign, Rounding and Modulo in CSS Today

For quite a while now, the CSS spec has included a lot of really useful mathematical functions, such as trigonometric functions (sin(), cos(), tan(), asin(), acos(), atan(), atan2()), exponential functions (…

Ana Tudor on Jul 28, 2021
Direct link to the article Of Course We Can Make a CSS-Only Clock That Tells the Current Time!
calc css animation custom properties

Of Course We Can Make a CSS-Only Clock That Tells the Current Time!

Let’s build a fully functioning and settable “analog” clock with CSS custom properties and the calc() function. Then we’ll convert it into a “digital” clock as well. All this with no JavaScript!…

Mate Marschalko on Jul 16, 2021
Direct link to the article The Dilemma of Naming Font Size Variables
custom properties font-size naming

The Dilemma of Naming Font Size Variables

Normally, a project will have a set of pre-determined font sizes, usually as variables named in such a way that seeks some semblance of order and consistency. Any project of considerable size can use something like that. There are always …

Martin Lexelius on Jul 6, 2021
Direct link to the article Custom Property Brain Twisters
custom properties

Custom Property Brain Twisters

I am part of that 82% that got the answer to Lea Verou's quiz wrong. Stephen Shaw posted a similar quiz as well and it's a fun exercise sharpen your CSS chops.
Chris Coyier on Jun 25, 2021
  • Newer
  • 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