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/

Établi 1mo | 6 mars 2025, 18:10:27


Connectez-vous pour ajouter un commentaire

Autres messages de ce groupe

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 avr. 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 avr. 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 avr. 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 avr. 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 avr. 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 mars 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 mars 2025, 16:50:07 | CSS tricks