alt.hn

2/13/2026 at 8:02:23 AM

CSS-Doodle

https://css-doodle.com/

by dsego

2/13/2026 at 2:45:14 PM

This is very cool. I have no idea how this one work. I'm guessing most of the magic is in the box shadow?

https://codepen.io/yuanchuan/pen/OJRqGvz

by gandreani

2/13/2026 at 4:38:52 PM

Same

I don't understand how so few lines can produce so much different things.

And clicking on the background will just create a new random (?) background!

It seems that the aliases are doing a lot of work

by wiether

2/13/2026 at 4:48:13 PM

The aliases we're tripping me up! I almost understand it now. Not sure what the @lp is doing

by gandreani

2/13/2026 at 3:19:03 PM

As an aside but still relevant question, why is CSS preferred over JS when these days it can do lots of things like JavaScript and probably uses similar resources.

by smusamashah

2/13/2026 at 3:39:03 PM

CSS and JavaScript specialize in two very different areas and are commonly used in tandem

by Minor49er

2/13/2026 at 4:04:08 PM

You can do layouts with javascript?

Couldn't imagine ever wanting skip grid and flexbox for whatever has been concocted up for JS.

by soperj

2/13/2026 at 6:11:46 PM

multi-window interfaces in the browser... simulating a desktop, or other user navigable environment such as in a game or simulation, where a user my want to customize their environment beyond a grid snap.

by tracker1

2/13/2026 at 7:02:42 PM

1. This isn’t CSS. It’s a declarative JS drawing framework with CSS flavor to the syntax

2. Without actual CSS JavaScript wouldn’t be of much use for drawing much of anything unless you were just going to use canvasses and forego the DOM entirely

by k33n

2/13/2026 at 5:21:03 PM

I agree. This seems like it would make more sense as a canvas library unless there's a use case I'm not understanding.

by sublinear

2/13/2026 at 6:18:15 PM

I think there is value in making it a declarative model

by jtokoph

2/13/2026 at 8:05:48 PM

Man, CSS looks absolutely nothing like it did when I started out. lol

by webXL