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

Admonish looks weird with the Rust theme #172

Open
meator opened this issue Mar 24, 2024 · 1 comment
Open

Admonish looks weird with the Rust theme #172

meator opened this issue Mar 24, 2024 · 1 comment

Comments

@meator
Copy link
Contributor

meator commented Mar 24, 2024

This might not be a bug. But I find it weird.

screenshot

I have created a book based off of https://rust-lang.github.io/mdBook/format/markdown.html which should show all of the distinct elements mdBook can render. It can be found here: book.tar.gz

It shows that no other element is using such dark colors in the body of the page with the Rust theme. This makes the admonish notes pretty disruptive. All of the notes immediately stand out from the page, even though they should just be additional informative notes (or something else).

@tommilligan
Copy link
Owner

Agreed this doesn't look great - happy for some alternative that doesn't create such a high contrast element.

I'm aware of this as we use the theme CSS variables to do the styling, which in this case are

.rust :is(.admonition) {
    background-color: var(--sidebar-bg);
    color: var(--sidebar-fg);
}

image

Honestly IMO the easiest thing might be to just add a hardcoded special case for the rust theme because it's pretty weird compared to the others - this high contrast is kind of a feature of the theme, but I agree how we're using it doesn't look good.

The place to start investigating that would be here - actually looks like we already have a bunch of overrides specifically for Rust, so maybe just hardcoding some hex values is fine:

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

2 participants