- From: Sebastian Zartner via GitHub <sysbot+gh@w3.org>
- Date: Tue, 14 Mar 2023 21:45:26 +0000
- To: public-css-archive@w3.org
SebastianZ has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-backgrounds-4] Allow one value for `box-shadow-offset` == It is very common that authors define the same two values for the offset of their box shadows. Therefore, we should allow `box-shadow-offset` to only take one `<length>` value that applies to both offset directions. The only issue I see is that this makes the values in the `box-shadow` shorthand ambiguous. E.g. the value `10px 5px blue` could then be interpreted as `10px` for the horizontal and `5px` for the vertical offset (as it's currently the case) or `10px` for the horizontal _and_ vertical offset and `5px` for the blur radius. So it needs to be defined what to do in that case. We could either stay with the current syntax and define that the shorthand only allows two-value offsets, i.e. the second `<length>` to always be interpreted as vertical offset. Or we need to change the shorthand's syntax to distinguish the offset values from the blur and spread values. Given that we also [want to allow different values for the horizontal and vertical spread radius](https://drafts.csswg.org/css-backgrounds-4/#level-changes) (and possibly for the blur radius as well), we should probably go with the second option. This issue is very similar to #6946. And my suggestion would be the same here: Add slashes between the possibly ambiguous values. So the suggested syntax for [<spread-shadow>](https://drafts.csswg.org/css-backgrounds-4/#typedef-spread-shadow) is: ```abnf <spread-shadow> = <modern-spread-shadow-syntax> | <legacy-spread-shadow-syntax> <modern-spread-shadow-syntax> = <'box-shadow-color'>? && [ <'box-shadow-offset'> [ / <'box-shadow-blur'> [ / <'box-shadow-spread'> ]? ]? ] && <'box-shadow-position'>? <legacy-spread-shadow-syntax> = <'box-shadow-color'>? && [ <'box-shadow-offset'> [ <'box-shadow-blur'> <'box-shadow-spread'>? ]? ] && <'box-shadow-position'>? ``` Sebastian Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8581 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 14 March 2023 21:45:28 UTC