Re: [csswg-drafts] [css-backgrounds-4] `background-filter` (#4706)

As Eric notes, this use case was _supposed_ to have been addressed by the [`filter()` image function](https://drafts.fxtf.org/filter-effects-1/#FilterCSSImageValue) (which takes a CSS image + a list of filters and returns a new image with the filter applied, and which could be used anywhere a CSS image is accepted).

I believe WebKit has an implementation of `filter()`, not sure how comprehensive it is. No one else has implemented it, to my knowledge, even behind a flag.

If a `background-filter` property is more likely to be implemented, then it would address the most common use cases for `filter()`. There isn't a strong demand for filtering list images, after all. But filtering mask images would be useful, though. And when support for CSS images in SVG fill & stroke finally happens, filtering them would be useful, too.  All of which could be supported by similar paired properties (`fill-filter`, `mask-image-filter`, etc.) if that's the route we want to take.

It might be slightly more author-friendly to have a separate property (or properties, considering the other use case) instead of trying to jam everything into `background-image`. But I think most CSS authors would just be happy for an easy way to do blurred backgrounds or semi-transparent background overlays, without having to hack around with absolutely positioned pseudo-elements.

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

Received on Wednesday, 29 April 2020 02:58:51 UTC