Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom main and accent color. #466

Closed
GHXST01 opened this issue Sep 17, 2017 · 6 comments
Closed

Custom main and accent color. #466

GHXST01 opened this issue Sep 17, 2017 · 6 comments

Comments

@GHXST01
Copy link

GHXST01 commented Sep 17, 2017

Hey,

I absolutely love the theme and I'm using it for some documentation project I am doing whilst on my internship.
However, I would really like to change the colors of the theme to match the corporate colors, I have the hex of those, but I'm a bit stuck on how to update the .scss file.

What I tried was including an extra stylesheet as you mention in the docs, and this works great when I (for example) want to edit every individual component on it's own.

But things get tricky when I need the colors to work correctly on for example mobile view, the scss has some custom ruling for that, which I don't know how to convert to plain css.

I also tried including the scss file of the application-palette, and adding a new color to the array like so:

@each $name, $color in (
  "red":         $clr-red-400,
  ...
  "new-red": #E31836
)

But when I select the new-red as color in the YAML file, it's not updating, so clearly I'm doing something wrong here and I was hoping you could tell me what it is.

Thanks for the amazing theme :)

@squidfunk
Copy link
Owner

Please refer to the customization guide, it contains an example for changing the colors.

@GHXST01
Copy link
Author

GHXST01 commented Sep 17, 2017 via email

@squidfunk
Copy link
Owner

Yes, you can. Did you build the theme?

@GHXST01
Copy link
Author

GHXST01 commented Sep 18, 2017

Actually doing what's suggested solved this issue.
http://squidfunk.github.io/mkdocs-material/customization/#theme-development

@GHXST01 GHXST01 closed this as completed Sep 18, 2017
@ZacSweers
Copy link

Building a distributing a fork of mkdocs-material seems quite heavy-weight for setting a custom theme color. Would it not be possible to just support setting custom hex values in a palette?

@squidfunk
Copy link
Owner

You don’t need to recompile the theme. You can always just use extra CSS (see #874 for a discussion) to make your changes.

v5 (tracked in #1306) will make it even easier with CSS variables (implemented in #1409), which should be released in a few weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants