[csswg-drafts] [css-background-4] add background-layers property to set everything but background-color (#8726)

JaneOri has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-background-4] add background-layers property to set everything but background-color ==
spec: https://w3c.github.io/csswg-drafts/css-backgrounds/#the-background

We often run into situations where `background-color` has already been set for an element or component, and in a separate class we want to also add a background image to it.

In order to do this without overriding the color, we have to use the `background-image` property specifically.

Then we need to size, position, no-repeat it and that's 3 more short hand properties.

Add two bg images and we're managing parallel arrays to avoid overriding the background-color set elsewhere.

[It gets pretty tedious very quickly.](https://twitter.com/LeaVerou/status/1647617109835350016)

Fortunately, [the spec already defines a `<bg-layer>`](https://w3c.github.io/csswg-drafts/css-backgrounds/#typedef-bg-layer) so it may not be a big ask to _add `background-layers` as a property that defines everything for a background, excluding `background-color`._

`background-layers = <bg-layer># | none`

(suggesting plural `background-layers` even though the other shorthand bg properties are singular since they predate multiple image layers)

Thank you!



Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8726 using your GitHub account


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

Received on Sunday, 16 April 2023 16:25:58 UTC