Shadows on the floor sell the idea that a block has weight. A blurred ellipse, skewed to match the grid and placed slightly offset from the light, is usually enough. Real shadows would change with the height of the block, and adding that detail makes towers and stairs look much more convincing.
A code editor, a modern browser and about twenty minutes. No libraries or build step.
What it costs the browser
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.
Start with a checkbox
Use a real
input type="checkbox"so the control works with a keyboard and screen readers.Draw the track
Style the label as a tilted track with a darker right face.
Slide the block
Move the block with
translatewhen the input is checked, and skip the transition for reduced motion.
The code
Motion adds a lot to isometric scenes, and it is also the fastest way to make someone feel unwell. Wrap every animation in a prefers-reduced-motion query. For readers who ask for less motion we keep the scene still and use a small colour change on hover instead, which keeps the interface responsive without any movement.
Design tokens keep the whole team in step. We name colours by their role, such as face-top, face-left and face-right, rather than by hue. When we switched the site to a violet accent for a campaign, only the token values changed. Every illustration, button and chart followed without anyone opening a single component.
Before we publish any illustration we run it through a short review. Is the light direction consistent? Does every block sit on the grid? Is the art hidden from screen readers where it is decorative? Does it survive forced colours mode? It takes five minutes and catches most of the problems we used to fix after launch.
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.
Reading isometric art is a learned skill, and most readers have learned it from games and instruction manuals. That shared vocabulary is what makes the style so friendly. It also means readers notice immediately when something is off, even if they cannot say why, so consistency matters more than detail.
Performance is rarely a problem for one hero cube, but a scene with fifty transformed blocks is a different story. Each block may become its own compositing layer, and every layer costs memory. Open the Layers panel before you ship and count them. If the number surprises you, flatten the static parts into a single SVG.
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.
.floor { background-image: repeating-linear-gradient(30deg, var(--line) 0 1px, transparent 1px 40px), repeating-linear-gradient(150deg, var(--line) 0 1px, transparent 1px 40px);}
Colours used
Testing on real devices
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.
What you built
- A cube with three shaded faces
- A floor grid from gradients
- A hover state that lifts the block
Lena Vogel
I tried this on an old iPad and one of the faces flickers on hover. Any idea why?
Omar Haddad
The tip about naming faces instead of colours saved our design system a lot of pain.
Mara LindqvistAuthor
The templates are in the downloads section of the reference post.
Dana Ortiz
Agreed, this is the part most tutorials skip.
Kofi Mensah
This is the clearest explanation of draw order I have read.
Gus Lindgren
How would you handle text that needs to wrap on one of the faces?
Rosa Medina
Love the palette. Could you share the exact lightness values?
Nina Ahlberg
Fixed now, thanks for spotting it.
Eli Novak
The part about layer counts was eye-opening. Our landing page had over a hundred.