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

Add an empty, but included last, custom.css file #178

Closed
carols10cents opened this issue Nov 8, 2016 · 2 comments · Fixed by #287
Closed

Add an empty, but included last, custom.css file #178

carols10cents opened this issue Nov 8, 2016 · 2 comments · Fixed by #287
Labels
A-Style Area: Style (CSS, etc.) C-enhancement Category: Enhancement or feature request E-Medium Experience: Medium S-Wishlist Status: Wishlist

Comments

@carols10cents
Copy link
Member

I'd like to be able to add just a few little custom style rules, but I don't want to maintain my own version of book.css or highlight.css that might diverge from the mdbook provided styles.

What do you think about mdbook always including, or trying to include if it exists, a file named custom.css or similar, that mdbook would intentionally never add anything to?

This file would need to be included last, so that the rules in custom.css would be able to override rules in book.css or highlight.css.

I'd be happy to work on a PR for this, but wanted to see if this was something you'd be interested in first.

@azerupi
Copy link
Contributor

azerupi commented Nov 8, 2016

Definitely!
I planned to add this when the change to TOML configuration file and the Renderer abstraction was done. I envisioned something like below. (Not the final design, needs some thought)

[outputs.html]
path = "book/"
css = ["custom.css"]
js = ["custom.js"]

However, since things have been moving really slowly. I would definitely be open to a temporary solution. I don't want to block everything on a rewrite that could still take forever to get done 😕

@gambhiro
Copy link
Contributor

I added behaviour for this in multilang for #200.

It checks a few locations for a custom.css and if found, it adds a <link> to it after the template's css in the <head>.

It looks in the following paths, the first wins:

  • assets/css/custom.css
  • assets/stylesheets/custom.css
  • assets/custom.css

@carols10cents is this what you had in mind?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Style Area: Style (CSS, etc.) C-enhancement Category: Enhancement or feature request E-Medium Experience: Medium S-Wishlist Status: Wishlist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants