Top
Best
New

Posted by ChiptuneIsCool 3/30/2025

Minimal CSS-only blurry image placeholders(leanrada.com)
470 points | 75 commentspage 2
ssttoo 4/3/2025|
Another simple css-only solution as the article mentions is gradients. Like

  background: linear-gradient(
    to right,
    #51463e 0%,
    #28241f 100%
  );
Tool: https://tools.w3clubs.com/gip/
dmitrygr 4/3/2025||
cool, but the fact that you can now do this with CSS is part of the reason that a new browser engine is so unlikely - one of 100000 things that css can do now and need to be supported :(

Maybe we should have kept CSS simple and JS optional. Maybe we took a few wrong turns...

cjpearson 4/3/2025|
It's all additive so each new feature does indeed add complexity, but my impression is that it's often the older features and all their quirks which are the most difficult to implement. Adding a few math functions is much easier than ensuring compatibility with CSS2 floats.
duffyjp 4/3/2025||
Years ago before you could do anything this fancy with CSS I experimented with generating 3x2 pixel images server side and then presenting them as base64 encoded pngs in a "scoped" block of CSS to ensure they loaded before the src images. Coincidentally this was the same 3x2 layout as OP did here with CSS. I abandoned it because a 3x2 image scaled up looked terrible, and went with average color instead. This solution looks a lot better visually.

I still do the average color thing today since it's easy to calculate and store server side (I resize the uploaded image to 1x1 px and just record the result as a hex code in the DB).

biker142541 4/3/2025||
This works significantly better than I would have expected. I was just exploring extremely simple png strings as an alternative to the hash libraries requiring decoding. I had also explored two color css gradient, based on pregenerated major/minor colors, but too course to be useful (for a fast scrolling gallery). I’ll give this a test drive!
cynicalsecurity 4/3/2025||
Why is the page so sluggish on mobile?
simonw 4/3/2025|
Probably because of all of the wildly complex CSS calculations it's running, as described by the article.
Kalabasa 4/3/2025||
Yep, there are a lot of layers and compositing operations (maybe more than necessary?). I suppose it could be simplified further.
Hackbraten 4/5/2025||
Unusably slow for me on my Librem 5. I'm talking about two or three fps.
layer8 4/3/2025||
I read the title as “Minimal CSS — only blurry image placeholders” first by mistake. ;)
mike2323 4/3/2025||
broken on iOS (iPad)
thangngoc89 4/3/2025||
Also broken for me:

Safari 18.0 (20619.1.26.31.6), macOS Sequoia 15.0

tlb 4/3/2025|||
Me too. Thumbnails just appear black.

Safari 17.6 (19618.3.11.11.5), MacOS Sonoma 14.7.3 (23H417)

It works on Chrome on the same machine.

alwillis 4/3/2025|||
Works fine on macOS Sequoia 15.4 with Safari 18.4.
simonw 4/3/2025||
Worked for me in Mobile Safari in iOS on my iPhone.
VladVladikoff 4/3/2025|||
Maybe it’s iOS version dependant. I’m a bit out of date (on purpose for jailbreak) and the demo is broken for me.
whstl 4/3/2025||
I'm up to date and it's broken for me :/
wruza 4/3/2025|||
Same setup, didn't work. (Empty space where blur supposed to be.)
Reubend 4/3/2025||
It's a cool solution, and I like that it's CSS only. But the generated placeholders are way too blurry/lossy for my personal preferences.
bmandale 4/3/2025||
My attempt at the four color approach:

https://0x0.st/820Q.html

turnsout 4/3/2025|
Man, it's wild how much you can do with CSS calculations. How long before someone makes a CSS-only Game Boy emulator?
WorldMaker 4/4/2025|
I did find this Idle Game entirely in CSS amusing: https://lyra.horse/css-clicker/
More comments...