I want longhand properties for every CSS shorthand
Submitted by Cory Birdsong
Permalink https://webwewant.fyi/wants/ce0d5bb2-0cde-4698-8f0a-6320227f45cc/
This idea is currently being discussed.
Most CSS shorthand properties — like background, border, and font — come with individual longhand equivalents that let you set each component independently. This is essential for transitions and animations, where you often want to animate just one part of a compound value.
However, a few commonly used properties are missing their longhands entirely:
text-shadowhas notext-shadow-color,text-shadow-offset-x,text-shadow-offset-y, ortext-shadow-blurequivalents.box-shadowsimilarly lacks longhands for its color, offsets, blur, and spread values.
Without longhands, animating or transitioning a single component of these properties — say, fading just the shadow color on hover — requires rewriting the entire value in every keyframe or transition state. Developers work around this by declaring shadow values in CSS custom properties and animating the variable, but this is a cumbersome workaround for something that should be native.
I want longhand properties for text-shadow and box-shadow (and any other shorthands that still lack them) so that I can write clean, maintainable animations and transitions without duplicating full shadow declarations or resorting to proxy custom properties.
- Votes
- 0
What are votes for and how are they tallied?