Skip to content
Tutorials

Make a rotating isometric loader

A loading indicator that spins a cube and stops for reduced motion.

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.

What you need

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.

  1. Start with a checkbox

    Use a real input type="checkbox" so the control works with a keyboard and screen readers.

  2. Draw the track

    Style the label as a tilted track with a darker right face.

  3. Slide the block

    Move the block with translate when 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.

grid.cssCSS
.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
Share

Written by

Mara Lindqvist

Mara draws isometric city blocks in CSS and edits the Isometric Basics column. She once rebuilt a subway map using nothing but borders.

All 13 posts by Mara Lindqvist

9 comments

  1. Lena Vogel

    I tried this on an old iPad and one of the faces flickers on hover. Any idea why?

    Reply to Lena Vogel
  2. Omar Haddad

    The tip about naming faces instead of colours saved our design system a lot of pain.

    Reply to Omar Haddad
    1. Mara LindqvistAuthor

      The templates are in the downloads section of the reference post.

      Reply to Mara Lindqvist
      1. Dana Ortiz

        Agreed, this is the part most tutorials skip.

        Reply to Dana Ortiz
  3. Kofi Mensah

    This is the clearest explanation of draw order I have read.

    Reply to Kofi Mensah
  4. Gus Lindgren

    How would you handle text that needs to wrap on one of the faces?

    Reply to Gus Lindgren
  5. Rosa Medina

    Love the palette. Could you share the exact lightness values?

    Reply to Rosa Medina
    1. Nina Ahlberg

      Fixed now, thanks for spotting it.

      Reply to Nina Ahlberg
  6. Eli Novak

    The part about layer counts was eye-opening. Our landing page had over a hundred.

    Reply to Eli Novak

Leave a comment

Your email address won’t be published. Required fields are marked.