Customization Introduction
Learn the fundamentals of documentation customization
Customizing your documentation allows you to create a unique and branded experience for your users. There are three main approaches for customization:
-
Customization via settings file - choose from a variety of pre-built themes and tweak using available theme settings
-
Extending the default theme - build upon the existing design while adding your own enhancements via code
-
Creating a new theme - develop a completely new theme from scratch via code
Customization via Settings File
This is the simplest way to customize your documentation.
You can do this by editing the docs.json file in the root of your project.
For more details on the theme settings, see the reference guide.
Customization via Code
To customize your documentation via code, you'll need to work with a .docs/theme directory inside your project root:
theme/index.css
You can customize theme styles via index.css:
theme/index.tsExperimental
xyd will lookup for index.ts if you want to modify or create new theme behavior.
This file is only necessary when you need to extend default theme's functionality or create a new theme:
However, if you only want to customize styles, you can simply use index.css without creating an index.ts file.
Learn more about extending the default theme or creating a custom theme via code.
Theme Reference
Theme settings are defined as an object with the following reference:
name"poetry" | "cosmo" | "opener" | "picasso" | "gusto" | "solar" | stringRequiredlogoLogoLogolightstringdarkstringhrefstringpagestringstringstringReact.JSX.ElementReact.JSX.ElementfontsThemeFontFontFontfamilystringweightstringsrcstringformat"woff2" | "woff" | "ttf"Font[]Font[]faviconstringiconsIconslibraryIconLibraryIconLibrarynamestringRequiredversionstringdefaultbooleannoprefixbooleanstringstringIconLibrary[]IconLibrary[]appearanceAppearancecolorScheme"light" | "dark" | "os"colorSchemeButtoncolorsColorsprimarystringRequiredlightstringdarkstringcssTokens{ [token: string]: string; }presetsstring[]logoAppearanceLogosidebarboolean | "mobile" | "desktop"headerboolean | "mobile" | "desktop"searchAppearanceSearchfullWidthbooleansidebarboolean | "mobile" | "desktop"middleboolean | "mobile" | "desktop"rightboolean | "mobile" | "desktop"headerAppearanceHeaderexternalArrowbooleanseparator"right"type"classic" | "pad"buttonSize"sm" | "md" | "lg"tabsAppearanceTabssurface"center" | "sidebar"sidebarAppearanceSidebarexternalArrowbooleanscrollShadowbooleanscrollbar"secondary"scrollbarColorstringscrollTransition"smooth" | "instant"buttonsAppearanceButtonsroundedboolean | "sm" | "md" | "lg"tablesAppearanceTableskind"secondary"bannerAppearanceBannerfixedbooleancontentAppearanceContentcontentDecorator"secondary"breadcrumbsbooleansectionSeparatorbooleanfooterAppearanceFootersurface"page"writerWritermaxTocDepthnumbercopyPagebooleancoderCoderlinesbooleanscrollbooleansyntaxHighlightThemeheadarray of HeadConfig [string, Record<string, string | boolean>, ]scriptsstring[]
Full settings reference you can read here.
Show your support! Star us on GitHub ⭐️