PaperMod colors can be customized with CSS custom properties (variables). Put overrides in your site’s assets/css/extended/ directory rather than editing theme files, so they are easier to keep across theme updates. The example below defines a warm light palette and a dark palette; adjust the values for your site.
Dark mode and current variables
Current PaperMod switches dark mode by setting data-theme="dark" on the html element. Older examples that target only .dark may not match this theme selector. --hljs-bg is also not the current variable for the code-block background; the current name is --code-block-bg.
| |
Text contrast
In this example, the normal text colors --primary and --content contrast strongly with their backgrounds. The sample contrast for --primary against --theme is about 10.4:1 in light mode and 13.4:1 in dark mode. WCAG 2.2 AA requires 4.5:1 for normal text, but check syntax colors, links, borders, and other states separately.
Add and check extended CSS
Save the stylesheet as assets/css/extended/theme-colors.css at your site root. PaperMod’s FAQ says CSS files in assets/css/extended/ are bundled with the theme styles. Run Hugo and check the light/dark switch, cards, body text, inline code, code blocks, and links.
Scope
This is an illustrative palette; it does not guarantee accessibility conformance for every text string, image, or interactive component. Syntax-highlight colors are defined separately from --code-block-bg, so recheck code readability after changing the block background.
