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.


Maybe don’t use custom properties in shorthand properties originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

https://css-tricks.com/maybe-dont-use-custom-properties-in-shorthand-properties/

Creato 1mo | 6 mar 2025, 18:10:27


Accedi per aggiungere un commento

Altri post in questo gruppo

CSS Carousels

Chrome has prototyped these features and released them in Chrome 135. Adam Argyle has a wonderful explainer over at the Chrome Developer blog. Kevin Powell has an equally wonderful video where he f

9 apr 2025, 13:50:07 | CSS tricks
Feeling Like I Have No Release: A Journey Towards Sane Deployments

Deploying like an idiot comes down to a mismatch between the tools you use to deploy and the reward in complexity reduced versus complexity added.


7 apr 2025, 15:30:26 | CSS tricks
A New “Web” Readiness Report

HTML 5 Readiness was a site that showed through a rainbow of colors the browser support for several web features. What about a new version?


4 apr 2025, 13:20:07 | CSS tricks
SMIL on?

Well, it turns out that SVG's built-in animation features were never deprecated as planned. Sure, CSS and JavaScript are more than capable of carrying the load, but it's good to know that SMIL is n

2 apr 2025, 12:40:05 | CSS tricks
Crafting Strong DX With Astro Components and TypeScript

One thing we can do to help teams code consistently is provide type-checking so that all of the configurable options for a specific component are available while coding. Bryan demonstrates how he d

1 apr 2025, 15:50:06 | CSS tricks
Worlds Collide: Keyframe Collision Detection Using Style Queries

Interactive CSS animations with elements ricocheting off each other seem more plausible in 2025. While it’s unnecessary to implement Pong in CSS, the increasing flexibility and power of CSS reinfor

31 mar 2025, 16:40:08 | CSS tricks
Automated Visual Regression Testing With Playwright

With visual regression testing, we can update a page, take screenshots before and after the fact, and compare the results for unintended changes. In this article, learn how to set up visual regress

28 mar 2025, 16:50:07 | CSS tricks