-
Notifications
You must be signed in to change notification settings - Fork 321
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
Instructions to change the dark mode code block styling don't work #49
Comments
HUH! Indeed. Looks like I've read the Sphinx code wrong! Sphinx doesn't seem to allow customising the dark color theme out-of-the-box. I might need to start getting hacky about this. :o |
Fixed in d5df1d4. :) |
@pradyunsg I updated to I tried deleting the build folder and loading the page with no browser cache. No luck. I double-checked site-packages and it appears to have your changes. E.g. |
I think I reproduced the behaviour you're describing and released a fix in beta24. Try that out and lemme know if it works! :) |
@pradyunsg Updated to |
Try cleaning up the previous build's artifacts? I'm unable to reproduce this. If it's still happening, could you provide a reproducer for this (and reopen the issue as well)? :) |
Do you mean open a new issue for the same issue? I don't have the permissions to have a reopen button for this one. I tried in a fresh virtual environment.
I did a html_theme = 'alabaster' with html_theme = 'furo'
pygments_style = "sphinx"
pygments_dark_style = "monokai" I appended the lines .. code-block:: Python
def foo(a=1,b='b'): pass to the generated I ran The browser and server don't seem relevant however. I double-checked the I manually changed the line .highlight .k { color: #6ab825; font-weight: bold } /* Keyword */ in .highlight .k { color: #fff; font-weight: bold } /* Keyword */ and the highlighting color changed, so this is the stylesheet that is definitely being applied in dark mode. I checked I appended the line import furo; print("Furo:", furo.__version__) to I added a
That looks wrong. I changed it like so:
Now the built dark highlighter isn't |
Well well well. What happens on newer versions of Sphinx? This might be an environment management bug in the older Sphinx version, maybe? |
Updated to |
Fresh environment is the same. Debugger inspection is the same. |
This should be resolved with beta25. Could you try again? |
Fresh environment with new versions
is the same.
And again, I can manually set |
What is Sphinx doing... |
Okay, with 784a670, this is definitely done now. You should be able to try this by using |
Maybe a separate issue, but I've noticed that formatting for a light pygments theme (tango) bled through to the formatting for a dark theme (monokai). It works fine if I use the same theme for both. Anything the dark theme left unspecified was set by the light theme. E.g. for number literals, the color worked as expected, but became bold text in the dark theme only when I had tango as the light theme. |
Hiya! Please file a new discussion for this. Making comments on closed issues makes things harder for me to keep up with. |
URL: https://pradyunsg.me/furo/customisation/colors/#code-block-styling
What is missing or inaccurate about the content on this page?
Not sure if this is a doc issue or a bug. Instructions to change the dark mode code block styling don't work. (They do work for light mode.) Tested using
Sphinx==3.3.1
andfuro==2020.12.9b21
, the latest versions released on PyPI.I pasted these lines in my
docs/conf.py
used by Sphinx.Changing
pygments_style
to another valid Pygments style affects the syntax highlighting in light mode when I rebuild the docs with Sphinx, but changingpygments_dark_style
doesn't do anything. Dark mode is always the same style.The text was updated successfully, but these errors were encountered: