Workshops taught us more than any tutorial. Watching people fold paper cubes and then rebuild them in CSS showed exactly where the mental model breaks: the order of rotations, the origin of each face, and the moment a block turns inside out. Most of our tutorials now start with the paper version for that reason.
A code editor, a modern browser and about twenty minutes. No libraries or build step.
What games already solved
Responsive isometric scenes need a plan for narrow screens. Sometimes the answer is to scale everything down with clamp(), and sometimes it is to hide secondary blocks entirely. What rarely works is letting the scene overflow sideways, which makes the page scroll horizontally and feels broken on a phone.
Sketch the layout
Draw the room on triangle-grid paper and number the tiles by column and row.
Create the grid
Use
display: gridwith equal columns and rows on the tilted floor.Place the furniture
Position each block with
grid-areaand sort the markup by depth.Add the walls
Two extra planes, rotated upright, close the room at the back.
Check it on a phone
Scale the scene with
clamp()so it never overflows the viewport.
The code
Three colours carry the whole illusion. The top face is the lightest because it faces the sky, the left face sits in the middle, and the right face is the darkest. Keep those three roles consistent across the page and readers stop seeing flat shapes. Break the rule once, with a dark top on a single block, and the entire scene looks wrong.
Isometric drawing keeps every parallel line parallel. There is no horizon and no vanishing point, so a block at the back of the scene is exactly as large as one at the front. That sounds like a limitation, but it is the reason the style works so well for diagrams: you can measure anything, compare anything, and line things up without fighting perspective.
Game artists have a name for the pixel-art version of isometric: two-to-one. Lines climb one pixel for every two across, which gives clean, stair-stepped edges instead of jagged ones. The angle is about 26.6 degrees rather than 30, and almost nobody notices, which is a nice reminder that looking right beats being exact.
The classic CSS recipe is rotateX(60deg) followed by rotateZ(-45deg). The first rotation tips the square away from you; the second turns it so its corners point up and down. Together they give the familiar diamond. Swap the order and you get something else entirely, because transforms apply from right to left, which catches almost everyone at least once.
Accessibility for decorative art is mostly about getting out of the way. If an illustration adds no information, hide it from assistive technology with aria-hidden on its wrapper. If it does carry meaning, such as a chart, give it a text alternative that says what the picture shows, not how it was built.
.scene { --unit: 2rem; transform: rotateX(60deg) rotateZ(-45deg); transform-style: preserve-3d;} .cube { width: calc(var(--unit) * 3); aspect-ratio: 1; background: var(--face-top);}
<label class="toggle"> <input type="checkbox"> <span class="block"></span> Dark mode</label>
.toggle input:checked + .block { translate: 2rem 0;}
toggle.addEventListener('change', (event) => { document.body.classList.toggle('dark', event.target.checked);});
Colours used
Lessons from the workshop
Icons are the hardest isometric art to get right because there is so little room. At small sizes one of the three faces usually has to go, so we pick the two that best describe the object. A book keeps its cover and spine; a box keeps its top and front. Deciding early saves a lot of redrawing.
Stacking order is the part that trips people up. In a flat layout, later elements paint on top. In a tilted scene, a block that is further back must paint first, even if it appears later in the markup. Either sort your markup by depth or give each block a z-index derived from its row and column.
The best way to learn isometric CSS is to rebuild something you see every day. A mug, a keyboard key or a stack of books all make good first projects. They are simple enough to finish in an evening, and each one teaches a different trick, from rounded tops to repeating elements.
What you built
- A cube with three shaded faces
- A floor grid from gradients
- A hover state that lifts the block
Pia Jensen
Tiny typo in the second code block: the unit is missing on the translate value.
Hana Sato
Thanks for covering reduced motion. It is so often an afterthought.
Ivo Petrov
Yes, container queries work well; we will cover them soon.
Quinn Adler
The part about layer counts was eye-opening. Our landing page had over a hundred.