Re: [csswg-drafts] [css-backgrounds-4] Added box-shadow-* longhand properties (#6083)

> It's hard to review this properly because the entire text from backgrounds-3 is brought in and then edited, so it's hard to know what the delta is. The PR as it currently stands includes stuff about drawing shadows, which is not relevant to breaking down the syntax into longhands.

I've removed the Background 3 parts now. So it should be easier to review the changes.

> * `box-shadow-offset` is not consistent naming with any other property that takes a horizontal and vertical offset.
> * Yes, CSS is internally inconsistent here. We have conflicting precedents for `*-position` properties: `list-style-position` to follow for `inset | outset` and things like `background-position`.
> * OTOH `background-position` does not specify _offsets_ from an initial position, it specifies a whole new position. So maybe that is not a good precedent to follow. What else in CSS specifies offsets? There is `top` and `left`, `translate`, what else?

There are several reasons why I chose `box-shadow-offset` as name.

1. It defines an offset from the element's box.
2. Backgrounds 3 already calls those values "offsets".
3. It is the controlling property in the linked list-valued properties and therefore it takes the `none` value from the `box-shadow` shorthand. And `box-shadow-offset: none;` fits quite well, in my opinion.

> * We should have separate horizontal and vertical longhands. Not sure if these should be physical (like `background-position`) or logical. I defer to @fantasai on that.

I don't see a strong use case for having separate longhands for the two axes. And it seems @tabatkins [agreed on that on a call](https://github.com/w3c/csswg-drafts/issues/4431#issuecomment-1016728393):

> <emilio> smfr: should box-shadow-offset be further broken down into x/y offsets?
> <emilio> TabAtkins: [meh reaction]

But iff we add them, they have to be physical because the existing offsets in Backgrounds 3 are also physical. We might then add logical counterparts in addition to them, though.

>  * If we name the offset property `box-shadow-position`, we should name the one for `inset` differently. Perhaps `box-shadow-placement`?

I like the suggested name `box-shadow-placement` and I am open to rename it to that or something else but please see [my comment on why I chose that name](https://github.com/w3c/csswg-drafts/issues/4431#issuecomment-1016946929).

Anyway, bikeshedding the names can still be done after landing this patch.

Sebastian

-- 
GitHub Notification of comment by SebastianZ
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/pull/6083#issuecomment-1272631668 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Sunday, 9 October 2022 21:28:55 UTC