tomusborne / generateblocks

GenerateBlocks is a small collection of lightweight WordPress blocks that can accomplish nearly anything.
https://generateblocks.com
194 stars 19 forks source link

Add support for `image-set()` in Advanced Backgrounds #1071

Open onetrev opened 1 year ago

onetrev commented 1 year ago

Description

Right now we can set different backgrounds for different breakpoints. That is great if you want to change the image entirely, or change something like the background-position at different sizes. But it outputs the CSS as media queries.

However, to have your CSS be more performant / appropriate for different devices (different DPIs) then it would be great to have the CSS output as image-set() -- now that it is supported by all major browsers and recent versions.

References:

More info on image-set() -> https://developer.mozilla.org/en-US/docs/Web/CSS/image/image-set