Ollie Theme Academy

Implementing Dimension Settings

Adding a spacing palette

Spacing palette handling changed significantly between theme.json version 2 and version 3, similar to font size changes. Understanding these differences is crucial for modern block theme development.

In version 2, you had to create a spacing scale with zero steps to remove WordPress defaults, then rebuild your spacing system from scratch. This was clunky and required replicating core functionality just to override it.

Version 3 introduces the “defaultSpacingSizes” flag – simply set it to false to disable WordPress defaults and enable your custom spacing palette. This is much cleaner and aligns with how other settings work.

You can then use either a spacing scale (algorithmic generation) or spacing sizes (manual palette) to define your spacing system. These are mutually exclusive, so choose the approach that best fits your design system needs.

Back to: Ollie Theme Academy > Implementing Dimension Settings