Customization Guide
This guide shows you how to customize your Material for MkDocs site.
Theme Customization
Colors
Change the primary and accent colors in mkdocs.yml:
theme:
name: material
palette:
- scheme: default
primary: deep purple # Change this
accent: amber # And this
Available colors: red, pink, purple, deep purple, indigo, blue, light blue, cyan, teal, green, light green, lime, yellow, amber, orange, deep orange, brown, grey, blue grey, black, white
Fonts
Customize fonts in mkdocs.yml:
Popular options: Roboto, Open Sans, Lato, Montserrat, Ubuntu, Source Code Pro (for code)
Logo and Favicon
Add your own logo and favicon:
Place images in docs/assets/ directory.
Navigation Features
Enable Tabs
Add tabs to the top navigation:
Table of Contents
Position the table of contents:
Instant Loading
Enable instant page loading (SPA-like):
Back to Top Button
Content Features
Code Copy Button
Already enabled in this site:
Code Annotations
Enable code annotations:
Then use in code blocks:
- This is an annotation!
Tabs
Create tabbed content:
Admonitions
Create styled callouts:
Types: note, abstract, info, tip, success, question, warning, failure, danger, bug, example, quote
Social Links
Add social media icons to the footer:
extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/yourusername
- icon: fontawesome/brands/twitter
link: https://twitter.com/yourusername
- icon: fontawesome/brands/linkedin
link: https://linkedin.com/in/yourusername
Custom CSS
Add custom styles:
- Create
docs/stylesheets/extra.css:
- Reference in
mkdocs.yml:
Analytics
Add Google Analytics:
Footer
Customize the footer:
extra:
generator: false # Remove "Made with Material for MkDocs"
copyright: Copyright © 2024 Your Name
Plugins
Blog Plugin
Install and add a blog to your site:
Tags Plugin
Add tags to pages:
Git Revision Date
Show last updated date:
Advanced Customization
Custom Templates
Override Material templates by creating files in overrides/:
- Set custom directory:
- Create template overrides in
overrides/matching Material's structure
JavaScript
Add custom JavaScript:
- Create
docs/javascripts/extra.js - Reference in
mkdocs.yml:
Examples
Popular Color Schemes
GitHub Dark:
Dracula:
Nord:
Resources
- Material for MkDocs Documentation
- Setup Guide
- Reference Documentation
- Customization Examples
- Available Icons
Testing Changes
After making changes:
Visit http://127.0.0.1:8000 to see your changes live!