Re: [csswg-drafts] [css-shapes][css3-backgrounds] No explicit <position> serialization steps in background spec (#368)

Thanks, I would have found this issue if I had searched on this topic without the `css-shapes` label.

If I understood correctly :
- `<bg-position>` should be serialized as `<position>`
- to sum up the two following points: `<position>` should be serialized with 2 or 4 values
- `<position>` should be serialized with all components of the syntax matched by the input value, no matter if they were omitted or equal or equivalent to the default value (eg. `50%`, `center`, `center 50%`, `50% center`)¹, because it would complicate round-tripping (from/to parsed/serialized values)², and because parsing `transform-origin` would become ambiguous
- `<position>` specified with 3 values ​​must be serialized by adding a missing keyword (`top` or` left`), or by adding a missing percentage and eventually replacing the keyword (`bottom` by ` top `,` right` by `left`)

The [current spec for `transform-origin`](https://drafts.csswg.org/css-transforms/#propdef-transform-origin) does not use `<position>`, but I'm assuming that it may be updated to specify that `transform-origin` should be serialized as `<position>`.

¹ I should note that it makes sens to me also because it would be weird to get `circle(center 50px)` not serialized to `circle(50px)` when the target box is 100px tall, and because an exception would have to exist for keeping at least 1 value when `<position>` is used alone to define the property.
² I understand this point even though I think it might not be not so obvious to a CSS developer.

-- 
GitHub Notification of comment by cdoublev
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/368#issuecomment-981389906 using your GitHub account


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

Received on Monday, 29 November 2021 09:10:04 UTC