Replicate primary color selector #2925
-
Either of the following will make me very happy :)
I'd like to replicate the functionality shown in the documentation that allows the primary color to be updated by clicking the relevant color value, as shown here: https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#primary-color I have raided the code source to see how it was done (feel like there's should be a plugin to inject this) and I have the functionality working, but the buttons aren't colored. I removed a couple of lines from the script which related to the code snippet having the value replaced:
All the colours change, just the bottons not being coloured is the issue. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You also need to add the extra CSS, not only the HTML + JS: .md-typeset .mdx-switch button > code {
background-color: var(--md-primary-fg-color);
color: var(--md-primary-bg-color);
} |
Beta Was this translation helpful? Give feedback.
You also need to add the extra CSS, not only the HTML + JS: