Open phistuck opened 5 years ago
The solution should be image.svg#key=value
and be part of the SVG spec, not CSS.
@Crissov - while I only mentioned SVG, there might be other formats that can be passed data. Maybe formats that support elaborate alpha channels (WebP). I do not have a concrete idea for how other formats can take data, but maybe others can.
I do not mind filing an issue with SVG as well, just food for thought.
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 -
<use>
or similar per color).Maybe media fragments can be reused here, too -
But then you cannot combine image.svg#some-use-id and passing more data.