Overriding h1 style on custom light theme #3151
-
I'm trying to use a custom light theme with custom h1/h2/h3 colors but i can't make it work properly. We used to not have a dark mode so this extra_css did work:
We are currently trying to add a dark mode so we need to wrap our custom colors like the docs suggest:
With this mkdocs config:
Primary colors work as usual but .md-typeset h1 color gets overwritten and defaults to --md-default-fg-color--light making it grey and not "compatible" with our company palette. Is there something i'm doing wrong? Thanks! TLDR: I need to change our h1/h2/h3 colors but only on light theme. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You're using SCSS syntax: [data-md-color-scheme="custom"] {
.md-typeset h1 {
color: var(--md-primary-fg-color--dark);
}
} Browsers don't recognize SCSS syntax (yet), only CSS which doesn't allow for nesting. Try: [data-md-color-scheme="custom"] .md-typeset h1 {
color: var(--md-primary-fg-color--dark);
} |
Beta Was this translation helpful? Give feedback.
You're using SCSS syntax:
Browsers don't recognize SCSS syntax (yet), only CSS which doesn't allow for nesting. Try: