Grids are the backbone of every scene we draw. A single grid unit decides tile width, block height and spacing, which is why our illustrations line up even when three different people made them. When something looks off, the first thing we check is whether one element quietly ignored the grid.
A code editor, a modern browser and about twenty minutes. No libraries or build step.
When to switch to SVG
Custom properties make isometric CSS far easier to maintain. Instead of hard-coding sizes, we define a single unit on the scene wrapper and multiply it everywhere else. Changing the unit rescales the whole illustration, keeps the proportions intact and means a phone layout needs one media query instead of twenty.
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
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.
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.
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.
Testing on real devices matters for 3D transforms. Emulators get the layout right but not always the rendering, and older phones sometimes draw faces in the wrong order or with visible seams. We keep a drawer of old handsets for exactly this reason, and every tutorial gets a quick check on each of them.
We keep every demo in a small repository with one folder per post. Each folder has the HTML, the CSS and a short note on what we tried and dropped. Months later, when a reader asks why a tutorial does something a certain way, the note usually has the answer and saves us a long investigation.
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.
Browser support for 3D transforms is excellent today, with a few sharp edges. The main one is that certain properties, such as overflow hidden or some filters, quietly flatten a preserve-3d context. If a face disappears or a block turns flat, look for one of those on an ancestor before you start rewriting your transforms.
.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);}
Colours used
Tokens that survive a redesign
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.
What you built
- A cube with three shaded faces
- A floor grid from gradients
- A hover state that lifts the block
Ivo Petrov
Is there a way to do the shadow without a pseudo-element? Our CMS strips empty spans.
Farah Aziz
I teach an intro CSS class and I am going to use this as the final project.
Theo OkaforAuthor
Glad it helped. The values are in the colour ratios reference.
Soren Dahl
I tried this on an old iPad and one of the faces flickers on hover. Any idea why?