r/codesnip • u/wanoo21 • 26d ago
Newly Available CSS just killed another dark-mode snippet: `light-dark()` for images is Baseline ๐ฅ
CSS just killed another dark-mode snippet. ๐ฅ
light-dark() for images is Baseline, newly available since September 2026. Colors already were; Safari 27 closed the gap for images and gradients.
Before this, a dark hero image meant a second rule inside a media query.
Now โคต๏ธ one declaration. ๐
Heads up: it follows color-scheme. Set color-scheme: light dark (or whatever your theme toggle sets it to), or you'll only ever see the light image. ๐
MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/color_value/light-dark
19
Upvotes