[csswg-drafts] [css-backgrounds-4] Pass data to the background image (#3644)

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

== [css-backgrounds-4] Pass data to the background image ==
https://www.w3.org/TR/css-backgrounds-3/#the-background-image

When using SVG as a background image (this makes the CSS encapsulates everything in the design), its colors cannot be changed and CSS custom properties are not cascaded.
Adding a mechanism to pass data (maybe very limited data, in a standardized fashion, like only fill and stroke or similar) would make the images much more dynamic and suitable to a lot of use cases.
For example, a single image is needed in multiple colors per case.
The current options are -
- Sprite (must create an image per color).
- image.svg#some-id (must create a `<use>` or similar per color).
- filters (not totally predictable/interoperable/accurate and may affect unrelated things)
None of them are great.

Maybe [media fragments](https://www.w3.org/TR/media-frags/) can be reused here, too -
```
<video src="video.mp4#t=10,20">
```
But then you cannot combine image.svg#some-use-id and passing more data.

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

Received on Monday, 11 February 2019 14:20:37 UTC