Skip to content
Tutorials

Tutorial index: every cube we have built

All our cube tutorials, grouped by difficulty.

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.

At a glance

Layer budget
Page type Transformed elements Notes
Article Up to 12 Hero and inline figures
Landing page Up to 40 Flatten static scenery
Dashboard Up to 8 Charts only

What it costs the browser

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.

Download

cubefold-cube-starter.zipHTML and CSS for a shaded cube, with a hover state. 571 B
Download cubefold-cube-starter.zip

Questions

Is isometric art accessible?

Decorative art is fine when hidden from assistive technology. Informative art needs a text alternative.

How many cubes are too many?

Once the Layers panel shows more than about forty layers, flatten the static parts into SVG.

Why does my cube look flat?

Something on an ancestor, such as overflow: hidden or a filter, is flattening the 3D context.

Which angle should I use?

Use true isometric for CSS and the 2:1 ratio for pixel art. Readers will not notice the difference.

Share

Written by

Sam Whitfield

Sam makes tile-based games in the evenings and brings the sorting tricks back to the blog. Currently building a very small harbour.

All 17 posts by Sam Whitfield

11 comments

  1. Eli Novak

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

    Reply to Eli Novak
  2. Ivo Petrov

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

    Reply to Ivo Petrov
  3. June Park

    The paper cube exercise sounds fun. Are the templates available somewhere?

    Reply to June Park
    1. Hana Sato

      Same here. Adding will-change on the wrapper fixed it for me.

      Reply to Hana Sato
      1. Bea Kowalski

        Good question. Usually that means something is flattening the 3D context; check for overflow hidden on a parent.

        Reply to Bea Kowalski
  4. Kofi Mensah

    Thanks for covering reduced motion. It is so often an afterthought.

    Reply to Kofi Mensah
  5. Farah Aziz

    This finally made the order of rotations click for me. I had them the wrong way round for weeks.

    Reply to Farah Aziz
  6. Tess Walsh

    Tiny typo in the second code block: the unit is missing on the translate value.

    Reply to Tess Walsh
  7. Omar Haddad

    Our designer drew the scene in Figma and I rebuilt it with your approach in an afternoon.

    Reply to Omar Haddad
    1. Nina Ahlberg

      Yes, container queries work well; we will cover them soon.

      Reply to Nina Ahlberg
  8. Soren Dahl

    Short and useful. More quick tips like this, please.

    Reply to Soren Dahl

Leave a comment

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