Skip to main content

The theme root

The theme root is the directory containing theme.json. Every published path is relative to it. The repository as a whole is not the theme. The first-party themes place it at site/:
A directory holding only .slurp files is a subfolder of a theme, not a theme root. Git deploys locate candidate roots by theme.json and reject a repository with none.
Publishing dist/ produces a bundle whose paths are all wrong. dist/ is the local preview target. The publish bundle is the theme root.

Directories

Paths outside this table are static files, stored and served as-is.

Compiled CSS

The CSS build must output inside the theme root, and the output is committed:
Publishing rejects a bundle whose templates link a root-relative stylesheet the bundle does not contain:
Without this check the failure is silent: the theme publishes, and every store using it renders unstyled HTML.
Only literal root-relative href values ending in .css are checked. A CDN link or an href containing ${ } is not verified.

Committed and generated files

  • Everything under the theme root, including css/theme.css
  • theme.json
  • dev-globals.json, if used. It is excluded from build output automatically.

Path rules

A path that violates any of these fails the publish, naming the file:
  • Non-empty, at most 300 characters
  • No leading /, no backslashes, no //, no trailing /
  • No segment that is empty, ., .., or starts with ~
  • Printable ASCII or spaces only
See Limits for file counts and size ceilings.

Next

Quickstart

Build a theme end to end.

Pages and routing

Route resolution and special pages.