Tips & Tricks¶
Quick tips and useful tricks to enhance your MkDocs Material experience.
Performance Tips¶
Styling Tricks¶
Quick Color Changes
Use Google Fonts
Self-hosted Fonts
Custom Palette
theme:
palette:
# Auto mode based on system
- media: "(prefers-color-scheme)"
toggle:
icon: material/link
name: Switch to light mode
# Light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/toggle-switch
name: Switch to dark mode
# Dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/toggle-switch-off
name: Switch to system preference
Keyboard Shortcuts¶
| Shortcut | Action |
|---|---|
| F or S | Open search |
| P | Go to previous page |
| N | Go to next page |
| / | Open search (alternative) |
Content Tricks¶
Deployment Tricks¶
Automatic Deployment
Create .github/workflows/deploy.yml:
Add CNAME
Create docs/CNAME:
Configure DNS
Add these records to your DNS:
Writing Tips¶
Follow Diátaxis
- Tutorials →
tutorials/- Learning by doing - How-to →
how-to/- Solving problems - Reference →
reference/- Looking things up - Explanation →
explanation/- Understanding concepts
Use Descriptive Names
✅ Good:
❌ Bad:
Group Related Content
Useful Resources¶
Quick Win
Bookmark this page for quick reference when working on your documentation!