Logo

Customization•3 min read|
|

Set a custom logo in the navigation bar with the logo field in docslit.json. When no logo is configured, DocsLit looks for one in your project (see Automatic detection) and otherwise shows a generated monogram next to your site name.

Use a path string for a single image. It appears next to the site name:

{ "name": "My Docs", "logo": "logo.svg" }

Place the image file in your project root, or use a path relative to the project root. DocsLit copies it to the build output when you run docslit build. Common formats are SVG, PNG and WebP.

Light and dark logos

A logo that works on a light background rarely works on a dark one. Give the object form a variant for each mode, and DocsLit swaps them when the reader changes mode:

{ "name": "Orbit", "logo": { "light": "logo/light.svg", "dark": "logo/dark.svg", "href": "https://orbit.example.com", "height": 28 } } The image shown in light mode. If you set only one of light and dark, it is used in both modes. The image shown in dark mode. Where the logo links to. Use it to send readers to your marketing site. By default the logo links to the docs home page. Text shown beside the image, such as Docs. The image height in pixels, from 1 to 120.

With the object form, the image is treated as a wordmark: the site name is not repeated beside it. Include your name in the image, or add it with text.

SVG files stay sharp on all screen densities and are usually the smallest. For a square mark with a PNG, use about 32 by 32 or 64 by 64 pixels.

Automatic detection

When logo or favicon isn't set in docslit.json, DocsLit looks for the files in the project root first, then in docs/assets/, assets/, public/ and images/:

Brand asset File names
Favicon favicon.svg, favicon.ico, favicon.png
Logo logo.svg, logo.png
Dark-mode logo logo-dark.svg or logo-dark.png, next to the logo

Explicit config always wins over detection.

Monogram favicon

If no favicon is configured or found, the build writes a favicon.svg: the first letter of the site name in white on a rounded square in your theme's accent color. When the accent isn't a hex color, the square is #111827. The monogram is also the nav logo when you have no logo.

Paths and URLs

A path that starts with / is treated as a site-root path, for example when the file is already in your output or served from a CDN. Full http and https URLs are used as they are, and DocsLit does not copy them.

docslit validate reports a logo object that has no light, dark or text as logo-invalid.

Next steps