Skip to content

theme.json reference

Every key Specly reads from theme.json, with its values and defaults.

4 min read

Updated

theme.json sits at the top of your docs folder and holds your site’s look. The dashboard writes it for you, and you can edit it by hand. Every key is optional, and what you leave out takes Specly’s default, or comes from docs.json where it has a matching key.

A key Specly doesn’t know stops the build, with a message that lists the allowed ones. So does a value of the wrong kind.

theme.json
{
"accent": { "light": "#2f47c5", "dark": "#97a3e2" },
"fonts": { "heading": "Fraunces" },
"chapterNumbers": "all",
"freshness": { "prNumbers": "never" }
}
Key Type Meaning
look editorial or product The layout, and the colours and fonts the site starts from. Default editorial. See Look.
background object The page background. See Background.
accent hex colour or object Links, the drop cap and the current page. Editorial’s default is #2f47c5 in light mode and #97a3e2 in dark.
accent2 hex colour or object Chapter labels. Editorial’s default is #a83f28 in light mode and #f08f72 in dark.
fonts object Fonts by role. See Fonts.
mode light, dark or toggle Which modes the site offers. Default toggle, or from docs.json’s appearance.
chapterNumbers guides, all or none Which tabs number their chapters. Editorial’s default is guides: every tab except API and reference ones. Product’s is none.
checks.links error or warn Whether a broken link stops the build. Default error, or warn for a site in Mintlify’s format.
banner.content string A line across every page, in inline Markdown.
banner.dismissible boolean Lets readers close the banner. Default false.
freshness.prNumbers auto, always or never Whether a page names the pull request it last changed in. Default auto: only when the docs repo is public.

A hex colour is six digits, such as #2b3a8c.

look picks one of two layouts. Each brings its own defaults, and every other key in theme.json still wins over them.

editorial product
Reads like A book: serif text on paper Product docs: sans-serif text on white
Text size 18 px 16 px
Background Paper, with a grain White, or near-black in dark mode
Accent #2f47c5, #97a3e2 in dark mode #1f5fe0, #8fb4ff in dark mode
Second accent #a83f28, #f08f72 in dark mode #0b7a6b, #5fd4c0 in dark mode
Fonts Newsreader, Schibsted Grotesk, IBM Plex Mono Inter, JetBrains Mono
Sidebar Chapters, numbered, a dot for each page A plain tree, closer together
Chapter numbers guides none
theme.json
{ "look": "product" }

background, accent and accent2 take one value for both modes, or an object with light and dark:

theme.json
{ "accent": { "light": "#1f3aa8", "dark": "#b4bdf0" } }

For accent and accent2, an object with any other key is an error. With a single colour, Specly lightens it for dark pages if it fails contrast there. With one for each mode, a failure stops the build.

typestringpathrequired

paper, color, gradient or image.

colorhex colourpath

For color, the background colour. For paper, an optional colour. A single color also gives dark pages a matching dark surface.

valuestringpath

For gradient, a CSS linear-gradient(...), radial-gradient(...) or conic-gradient(...), or a repeating one.

srcstringpath

For image, a path to a file in public/. The build stops if it isn’t there.

{ "type": "paper" } with no colour is the default, a warm paper with a light grain. A gradient or an image is a band across the top of every page, under the header, fading into the page. The page itself stays the default paper colour and no text sits on the band, so text is as readable as on plain paper.

theme.json
{ "background": { "type": "gradient", "value": "linear-gradient(135deg, #fde3d1, #e5defc)" } }

fonts takes heading, body, ui and code, each the name of a Google Font. Any other key is an error. Specly downloads the fonts at build time and serves them from your site.

Role Editorial Product
heading Newsreader Inter
body Newsreader Inter
ui Schibsted Grotesk Inter
code IBM Plex Mono JetBrains Mono

Specly checks that text, secondary text, muted and faint text, and both accents reach a contrast ratio of 4.5:1 on your background, in each mode. If one doesn’t, the build stops, and the message names the colour, its ratio and a colour to try. Docs.json’s colors are the exception: Specly moves them to the nearest passing colour and warns.

Was this page helpful?

Report a problem

What’s the problem?

The docs team sees this. Other readers don’t.