Creating 3D scenes with CSS has always been possible[0], but like this project, it's required JavaScript for interactivity.
But there's a lot more CSS features now. While in the past, Turing completeness in CSS required humans to click on checkboxes, now CSS can emulate an entire CPU without JavaScript or requiring user interaction.[1] So I wonder if DOOM could be purely CSS too, in real time.
> Yes, Lyra Rebane build a x86 CPU completely in CSS, but that technique is simply not fast enough for handing the game loop. So the result is something that uses a lot of JavaScript.
I feel obliged to repeat my assertion that this evolution of CSS was inevitable and foreseeable and that the HTML Editorial Review Board should’ve chosen DSSSL in the first place.
Great example as to why people are yearning for CSS in TypeScript. Something as simple as if() only works in Chrome and there's not a good shim story for CSS versus a more complete language, so you end up with this:
> The problem: CSS can compute a number – 0 for visible and 1 for hidden – but you can’t directly use that number to set visibility. There is a new feature coming to CSS that solves this: if(), but right now it only just shipped in Chrome.
> So I used a trick called type grinding. You create a paused animation that toggles visibility between visible and hidden. Then you set the animation-delay based on the computed value to determine which keyframe is used:
> A negative animation delay on a paused animation jumps to that point in the timeline. So a delay of 0s lands in the visible range, and -0.5s lands in the hidden range. It’s a hack, but a functional one. When CSS if() gets wider support, we can replace this with a clean conditional.
```
Even better, since everything is well organized, you can add `opacity: 0.7` to `.wall` specifically, and get something that looks almost exactly like how old school wallhacks looked like.
This feels like one of those “because we can” projects that accidentally reveals where the platform is going.
CSS started as purely declarative styling, but between things like conditionals, math functions, and now these rendering tricks, it’s slowly creeping into “programmable system” territory. Not because it’s the right tool for it, but because browsers are becoming the real runtime. The interesting question isn’t “can Doom run in CSS”, it’s how much logic we’ll keep pushing into layers that were never meant to handle it.
I think it would be too easy to create an uncontrollable cascade of function calls, causing terrible performance. IMO, it's best to keep concerns separated. Perhaps the current JS/DOM interface is a bit cumbersome, but it gets a lot done. What is your reason for merging?
Works smoothly in Firefox. But the default key mapping is busted: fire at Alt means that it opens and closes the menu in Firefox with each press. Also, Alt + left arrow ends the game and goes back in history.
Interestingly, it was more choppy in Chromium.
I could not find a key for moving sideways ("strafing").
Firefox's WebRender is truly a great creation. While Chrome is faster at most things especially involving JS, Firefox puts so much of its rendering on the GPU so moving elements around is incredibly fast.
Strafing is implemented on A and D at least, but having one hand on the arrows to turn and WASD to move is a bizarre mix of modern and original controls
I was amazed when I first came across CSS scroll snapping. It's great for creating immersive experiences where one part of the page fills the entire screen while native browser scrolling still works.
Yes, and in most cases it's perfectly valid not to interfere with scrolling. The nice thing about CSS scroll snapping is of course that the browser still handles it (instead of it being taken over by JS).
The demo really does not work in Brave. I use vertical scroll snapping on the landing page of one of my projects (enabled for screens with a min width of 768px and a min height of 600px - should work in Brave): https://cybernetic.dev
> "I used Claude to create an approximate version of the game loop in JavaScript based on the original DOOM source"
This is the real horror here, Uncanny-Valley gameplay Doom. It's like those Doom maps where people tried to recreate the game levels from memory, but still made a few mistakes and got some details wrong. This is like that, but for the gameplay rather than the level layouts. It's different enough to be wrong.
We have Green Armor that sets your armor to 200%. Health Bonuses that reset your health to 100% if you exceeded that number, too bad if you recently collected a Soul Sphere. Switch-activated doors that are supposed to stay open, but instead automatically close, but then the secret wall unexpectedly activates like a manual door.
This is so disingenuous. You literally clipped the full sentence that changes the context significantly.
> "Once I’ve proven to myself that rendering was feasible, I used Claude to create an approximate version of the game loop in JavaScript based on the original DOOM source, which to me is the least interesting part of the project"
This post is about whether you can render Doom in CSS not whether Claude can replicate Doom gameplay. I doubt the author even bothered to give the game loop much QA.
In 2006, Ars Technica published an April Fool's article[0] declaring that the perennially-forthcoming Duke Nukem Forever would finally see the light of day... as... a browser game! Ho ho, how droll.
In recent years CSS has become closer to a full programming language through experimental features, for example in 2025 they added if statements and some math functions like modulo
The fact that Claude is killing CSS officially means we need to switch back to IRC or something. AI is a parasite we cannot integrate but only avoid. (P.s. if you work in AI, stop, you are literally destructive to humanity.)
Couldn't agree more ... Especially how platforms like Stitch 2 are eliminating the barriers for non-technical individuals to actually get pretty decent UI/UX experience ..
I ran calypso.z3, tristam_island.z3 and a few more Zmachine text adventures under an interpreter created in PostScript.
Also if I want I can cross-compile a static build of Frotz for Linux/Misc and emulate it under a RISC interpreter for Linux syscalls written in... Perl, runable in every modern Perl port out there. Linux/RISC binary under Perl for NetBSD/Vax? Yes. Slow? Not much, it's a text game in the end.
But, as for the ZMachine, you can run text adventures in Android,
Game Boy, Amiga, MSDOS, Windows, Palm PDA's... anything 8bit and up.
Also, damn Sokoban under Eforth written in Subleq, a VM which can just:
- set up a 2^16 RAM size
- single opcode: substract A from B, if less than 0, go to addr in C.
- A < 0? Get ASCII input in B
- B < 0? Put ASCII output in B
- C < 0? End
This, just this, and people wrote Subleq simulators in C, AWK, Python, TCL, FPGA's and whatnot. And it will run Eforth, and that means... you can write a
ZMachine interpreter on it and be really slow if emulated in a Pentium 4 (maybe 3/5 seconds per command with a ZMachine on top of Eforth for Muxleq instead of Subleq), but the game will be playable and a great exercise on Turing completeness.
If a Mandlebrot render under Muxleq+EForth (with no floats used, just integers) is as fast as a C64/Amiga with a native Forth. then having that tiny EForth+Muxleq is not that useless.
Use 3D CSS to enhance a 2D page with some flair. But be aware, 3D CSS, it's trying to solve things that most realtime 3D rendering does not, like intersecting planes need to be subdivided in order to correctly handle transparency. This means 3D CSS has an O(N^2) or worse type of issue vs rendering yourself using WebGL or WebGPU where you'd avoid those issues. This demo probably does not intersect any planes but the browser itself has to check for those intersections anyway. TL;DR: If you're going to make a 3D web game use WebGL or WebGPU, not 3D CSS
Is CSS that awesome? It's still a language designed for styling webpages with 30 year of added features. I'd argue something purpose built would be a much better tool for the potential usecases people try to use CSS for now.
I guess I am asking, if modern CSS is so awesome, it's awesome compared to what exactly?
No doubt the very loudly opinionated not-web-dev community, who have So Much To Say about web devs and web tech, have produced an uncontroversial, perfect layout system, styling system, and language to produce the replacement for this awful web tech. Where is it? What is it? Please provide (the better version of) a hyperlink to the docs.
I think the argument lies in its flexibility and versatility (regardless of it being the most efficient or effective tool for this one particular task).
Duct tape is awesome for the same reason -- even though there are several effective use cases for duct tape where a different tool would technically be "better" for the job.
I am not sure what a purpose-built tool would look like, but the CSS-like language you see in UI frameworks like GTK is tailored for styling actual UI's.
In CSS on the web, just centering a div has historically been a problem. We have flexbox now, but what if CSS was designed with our current needs from the get-go?
But there's a lot more CSS features now. While in the past, Turing completeness in CSS required humans to click on checkboxes, now CSS can emulate an entire CPU without JavaScript or requiring user interaction.[1] So I wonder if DOOM could be purely CSS too, in real time.
[0]: https://keithclark.co.uk/labs/css-fps/ [1]: https://lyra.horse/x86css/
reply