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
Bold Code And Normal Code Look The Same #455
Comments
Project configuration, specifically extensions, may or may not be relevant. I would post them anyways, at the very least the extension setup, and extra if you adding any custom CSS. Most likely though, this is how styling is applied. I assume a base style is applied to code blocks and then the provided Pygment's style augments the base. I would provide the config regardless so it can be investigated further in case you are configuring things in an unexpected way. I'm not sure I would consider wrapping the code block in bold and not getting bold a bug. This may just be due to an assumption that doesn't hold true with this theme. Just because one theme handles things one way, does not mean all themes will handle things the same. |
Thank you @facelessuser for your time. site_name: My Docs
theme: 'material' That is all of it.
It depends on whether that assumption was a conscious choice or not. If the theme author consciously decided to make bold and normal code blocks look the same, I would be just disagree. |
Bold code blocks are actually very useful and necessary. For example I'm currently working on converting a book into markdown. There are lots of computer science books that are using typographical conventions. Please take a look at this pdf, page 3, Conventions Used in This Book. |
That's fine, but all that is happening is that the code block is then wrapped in This isn't unheard of. The idea of giving each element a known understood base, in this case, code, pre, and kbd have their text styling normalized to a consistent state with a font weight of 400. After that, a language style rule can then apply bold italic or color as dictated by the Pygment's color scheme provided. So Material seems to intentionally apply a common base font weight to code blocks despite what their parent element may be styled as. I personally feel the code block being code is emphasis enough. I'm not sure I see the benefit of emphasizing the whole code block further with bold, but that is most likely just me. I believe this could be forced by appending custom CSS via the mkdocs I'm going to guess that @squidfunk will not remove the default font-weight, but only he can answer that. So I would suggest pursuing some custom CSS overrides when a code block is wrapped with |
Hey guys, I intentionally defined the code block the same weight as normal text and only load the 400 weight via Google fonts. We can also append weight 700 to the loading directive, didn't think someone wants to use it. |
Thank you both. |
That was my initial concern, but we can add it, as it should be cached anyways. |
I don't think it worth it. I'll try to find some workaround for emphasizing the code blocks. |
I set the extra:
font: false option and still got the problem. shouldn't turning the google fonts off fix the problem? |
Hmm, theoretically yes. I have to check when I find the time. |
Fixed in 1.10.1, but there's currently some problem on Travis with the release that I have to go into before I can release it. |
I'm not sure whether this is relevant or not but I had some issues with |
No, it was some problem with |
the problem still exists |
My testing shows that it doesn't. It may depend on the font you choose, though, as not all code fonts come with bold weights. For |
Yes, You are right! It was my fault, It depend on the font! Thanks |
Description
The result of these markdown lines are the same:
Expected behavior
Fresh MkDocs Installation:

Actual behavior
Material for MkDocs:

Steps to reproduce the bug
Use the markdown in the description.
Package versions
Python 2.7.13
mkdocs, version 0.16.3
Version: 1.10.0
Project configuration
Not Relevant
System information
The text was updated successfully, but these errors were encountered: