-
Notifications
You must be signed in to change notification settings - Fork 719
[css-backgrounds] Make box-shadow a Shorthand Property #4431
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
Comments
Yeah, we've wanted to do this for a long while, precisely for the reason you give. Just haven't gotten to it yet. |
I guess |
Indeed. Unfortunately, text-shadow-color: <color>
text-shadow-offset: <length>{2} ; x/horizontal y/vertical
text-shadow-blur: <length> ; or 'text-shadow-radius'
text-shadow: none | <shadow>#
|
The suggested syntaxes are missing a few things:
So regarding those points, I suggest the following: For box-shadow-offset: [ none | <length>{2} ]#
box-shadow-color: <color>#
box-shadow-blur: <length>#
box-shadow-spread: <length>#
box-shadow-position: [ outset | inset ]#
box-shadow: <spread-shadow>#
For text-shadow-offset: [ none | <length>{2} ]#
text-shadow-color: <color>#
text-shadow-blur: <length>#
text-shadow-spread: <length>#
text-shadow: <shadow>#
Explanation: All longhand properties are defined to take comma-separated lists of values like the different The I've added the I've also renamed the data value of Sebastian |
It is very important, because a change of text-shadow color causes a I build a demo about this: https://codepen.io/ariarzer/pen/NWpdwza It can be used, for example, when you want to shift a text for hovered button without a div-wrapper inside, like this: https://codepen.io/ariarzer/pen/bGqwGNY |
Agenda+ for WG resolution before we merge the linked PR. |
The CSS Working Group just discussed The full IRC log of that discussion |
Summary of the discussion: Understood the use case, some concerns about making it not a terribly complicated thing to implement, because the existing linked list-valued properties are gnarly in the implementations, especially since the used lengths of the lists and the computed lengths of the lists don't match. Also some side-discussion about whether |
Summary of the discussion: yeah this seems fine, but there's a more general pushback against linked list-valued properties in general, as they're more expensive in impl than you might think. @dbaron suggests that the expense could be mitigated if we specified that the computed value is truncated/extended to the correct length, rather than having to maintain several distinct-length lists and match them up in some way. I don't have a problem with that? The fact that we don't already do that for the other linked properties (like background-*) seems like an unintentional detail; I suspect we couldn't change it now for backcompat reasons, but don't see why we wouldn't have been okay with the originally. If that's the blocker, we can just do it. |
It's ok for me to define that the computed value list length of the linked properties is determined by the one of the main property ( @dbaron I could also file a separate issue to investigate whether this could also be changed for existing linked list-valued properties if you think its worth to do it. Regarding Sebastian |
And for what it's worth, I plan to work on the definition for the Sebastian |
I think it's worth checking if other folks agree this would help, before adding an inconsistency based on my opinion alone. |
I've now finally merged the As this issue focused on With that, I think we can now close this issue. Sebastian |
box-shadow
box-shadow
Since box shadows are frequently altered on hover etc., but not all of its components need to change, can we make them available independently?
The text was updated successfully, but these errors were encountered: