Skip to content

Custom CSS and static files

Add your own styles with a custom.css file, and serve fonts and other static files from your docs folder.

Updated

Add a file named custom.css at the top of your docs folder, and Specly loads it on every page, after its own styles, so your rules can override them.

custom.css
.ed-banner {
letter-spacing: 0.02em;
}
.brand {
font-family: "Brand Sans", system-ui, sans-serif;
}

Then use your own classes in a page:

MDX
Welcome to <span className="brand">your product</span>.

Any image, font, PDF, audio or video file in your docs folder is served at its path, so a font can be loaded from custom.css:

custom.css
@font-face {
font-family: "Brand Sans";
src: url("/fonts/brand-sans.woff2") format("woff2");
font-weight: 400;
font-display: swap;
}

That’s the file fonts/brand-sans.woff2 in your docs folder. Files in public/ are served from the root of your site too. For the types Specly serves, and for what it leaves out, see Images and files.

Pages, docs.json and code files are never served as static files.

Was this page helpful?

Report a problem

What’s the problem?

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