# Customization It is possible to customize the output of the generated documentation with CSS and/or by overriding templates. ## CSS classes Our templates add [CSS](https://www.w3schools.com/Css/) classes to many HTML elements to make it possible for users to customize the resulting look and feel. To add CSS rules and style mkdocstrings' output, put them in a CSS file in your docs folder, for example in `docs/css/mkdocstrings.css`, and reference this file in [MkDocs' `extra_css` configuration option](https://www.mkdocs.org/user-guide/configuration/#extra_css): ```yaml title="mkdocs.yml" extra_css: - css/mkdocstrings.css ``` ## Symbol types ### Colors You can customize the colors of the symbol types (see [`show_symbol_type_heading`][show_symbol_type_heading] and [`show_symbol_type_toc`][show_symbol_type_toc]) by overriding the values of our CSS variables, for example: ```css title="docs/css/mkdocstrings.css" [data-md-color-scheme="default"] { --doc-symbol-sh-function-fg-color: #8250df; --doc-symbol-sh-script-fg-color: #0550ae; --doc-symbol-sh-function-bg-color: #8250df1a; --doc-symbol-sh-script-bg-color: #0550ae1a; } [data-md-color-scheme="slate"] { --doc-symbol-sh-function-fg-color: #d2a8ff; --doc-symbol-sh-script-fg-color: #79c0ff; --doc-symbol-sh-function-bg-color: #d2a8ff1a; --doc-symbol-sh-script-bg-color: #79c0ff1a; } ``` The `[data-md-color-scheme="*"]` selectors work with the [Material for MkDocs] theme. If you are using another theme, adapt the selectors to this theme if it supports light and dark themes, otherwise just override the variables at root level: ```css title="docs/css/mkdocstrings.css" :root { --doc-symbol-sh-function-fg-color: #d1b619; --doc-symbol-sh-function-bg-color: #d1b6191a; } ``` /// admonition | Preview type: preview
Try cycling through the themes to see the colors for each theme: