Skip to content
Performance

Watch: tuning transition timing

Why 180ms felt right and 300ms felt slow.

Edge lines deserve more attention than they usually get. A thin, slightly darker line along the bottom edges grounds each block, and a lighter line on the top edge suggests a highlight. Using currentColor for those lines means a single colour change on the wrapper restyles every outline in the scene.

Clip: Big Buck Bunny, (c) Blender Foundation, CC BY 3.0. Keyboard: Space play or pause, skip 5 seconds, M mute, F full screen.

Edges and highlights

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.

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.

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.

Share

Written by

Theo Okafor

Theo writes about 3D transforms and rendering performance. He keeps a spreadsheet of every browser bug he has hit with preserve-3d.

All 18 posts by Theo Okafor

5 comments

  1. Alex Moreau

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

    Reply to Alex Moreau
  2. Mateo Rossi

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

    Reply to Mateo Rossi
  3. Pia Jensen

    Any plans for a video version of this one?

    Reply to Pia Jensen
    1. Hana Sato

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

      Reply to Hana Sato
  4. Ivo Petrov

    Great write-up. Would love a follow-up on doing the same thing with SVG.

    Reply to Ivo Petrov

Leave a comment

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