Every Fern Docs website has a special configuration file called docs.yml
. Use this file to update the colors, background image, and fonts for your documentation site.
Colors
Primary accent
You can specify a primary accent color using the hexadecimal color. The primary accent color is used for several purposes, including:
- to indicate the page a user is on within the navigation
- as the background of a primary link button
- to underline hyperlinks
- the next and previous page navigation buttons
Background
Just like accentPrimary
, you can specify the background color using the hexadecimal color.
Background image
Include the background image or images in your fern/
project, then specify the path in docs.yml
:
The PNG, SVG, and JPG image formats are supported.
Single background image
You can set a single background image for both light and dark modes:
Light and dark mode background image
You can set a different background image for each mode:
Fonts
You can specify custom fonts for your documentation website. The supported file types are .woff
and .woff2
.
Include the custom fonts in your fern/
project:
Fern has three font types:
headingsFont
: affects page and section titles; if not supplied, defaults to the body fontbodyFont
: affects paragraph text and other body textcodeFont
: affects code blocks and inline code snippets
To customize the font used for each font type, add a top-level typography
list to docs.yml
. Then in it, specify the path of your font file for one or more of the font types.
A font has two properties:
name
: the name of the font; defaults to a generated name that will be used to reference your custom font in the eventually injected CSSpath
: the path to the font file
If the font file is not variable, you can specify font weights.
A font path has three properties:
path
: indicate that there are multiple font filesweight
: a string of weights that are supported by this font filestyle
: the style of the font file, eithernormal
oritalic