Skip to content

[css-backgrounds] [css-text-decor] box-/text-shadow longhands #6041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
valtlai opened this issue Feb 26, 2021 · 2 comments
Closed

[css-backgrounds] [css-text-decor] box-/text-shadow longhands #6041

valtlai opened this issue Feb 26, 2021 · 2 comments

Comments

@valtlai
Copy link
Contributor

valtlai commented Feb 26, 2021

The box-shadow and text-shadow properties currently don’t have longhand properties.

Should there be a box-shadow-color property, for example? It could be used to change just the color of a box shadow without respecifying the other values, or animating/transitioning just the color even if the some other values changed too.

I know these are already possible with custom properties and @property/CSS.registerProperty(), but the longhands would make things much terser.

Example
@property --box-shadow-color {
   syntax: '';
   inherits: false;
   initial-value: currentcolor;
}

div {
   box-shadow: 0 0 0
      var(--box-shadow-spread, 2px)
      var(--box-shadow-color);
   transition: --box-shadow-color 0.5s;
}

div:hover {
   --box-shadow-spread: 10px;
   --box-shadow-color: lime;
}

(Live demo)

Could be just:

div {
   box-shadow: 0 0 0 2px currentcolor;
   transition: box-shadow-color 0.5s;
}

div:hover {
   box-shadow-spread: 10px;
   box-shadow-color: lime;
}
@valtlai valtlai changed the title [css-backgrounds] [css-text-decor] {box,text}-shadow longhands [css-backgrounds] [css-text-decor] box-/text-shadow longhands Feb 26, 2021
@SebastianZ
Copy link
Contributor

This is a duplicate of #4431. And I totally agree that those properties should have longhands.

Sebastian

@valtlai
Copy link
Contributor Author

valtlai commented Mar 2, 2021

Oh, I don’t know why I didn’t found that, but I’ll close this issue now.

@valtlai valtlai closed this as completed Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants