Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
eurozerozero
@eurozerozero@mastodon.social  ·  activity timestamp 3 weeks ago

If you haven’t used it before, image-set() is used in CSS in any place where you’d normally use an image. Here’s a simple example where the browser will use JPEG XL if it supports it, or JPEG if it doesn’t:

background-image: image-set(
url("bg.jxl") type("image/jxl"),
url("bg.jpg") type("image/jpeg")
);

( you can also specify resolutions, e.g. url() 2x type() )

#Interop #WebCompat #JPEGXL

  • Copy link
  • Flag this post
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login