As someone hearted a 2015 demo of mine, I decided that since #CSS got better (and hopefully I did too), I should go for a quick 2024 remake.
Here it is on @codepen
https://codepen.io/thebabydino/pen/wKoVGN
It's mindblowing how much I could reduce the (esp. compiled) code - check it out!
HTML by 73%!
CSS by 70%!
I repeat: I shaved off at least 70% from each!
Back in '15, I had 16 cube elements, each with 3 descendants.
Now I have 16 empty cube elements.
I went from 64 descendants inside the grid element to just 16.
Back in '15, I was stacking all absolutely positioned cube elems in the middle, looping through them all to manually compute their grid positions incl. gaps, put them in the right place using translate(). This bloated compiled CSS.
Now I just use #CSS grid, no looping necessary!