Closed SebastianGode closed 6 months ago
@SebastianGode thanks for your contribution! I'll take a closer look soon. Can you add a changelog fragment? Thanks.
I've added a fragment. I'm not sure if it's correct, but I tried :)
I started working around these problems in #254. That PR makes it easy to add new color schemes (this PR would translate into creating a copy of the default scheme, adding a media query with redefinitions of the colors for dark mode, and allowing to select that color scheme in the config).
That way colors can be selected (or even defined) by the extension's user (who also has control over which theme and other extensions are used).
I went ahead and merged #254 so you aren't blocked on that PR. Note that I changed the way the node.js dependencies (sass and postcss) are installed, now you have to run npm install
or npm clean-install
in src/sphinx_antsibull_ext/css/ before running ./build.sh
.
Thanks for the work @felixfontein ! I will have a look, it seems like you added some variables which I can simply adjust, will need to try that stuff out.
@felixfontein I now think that I have fixed the tables in the narrow view. And adding the option to select different themes was awesome! That works like magic now :)
@SebastianGode thanks a lot for your contribution!
@felixfontein Would it be possible to get a new Release to PyPi? 😃
Yes, maybe later today or tomorrow. I want to add a small change before releasing.
I noticed that Antsibull didn't respect the
prefers-color-scheme
browser or system setting of the users which access the documentation website. This will result in completely unreadable tables for Sphinx-Themes which already include support for such user settings.To fix this I added some css code to change the colors accordingly for dark mode. The colors are chosen to get a contrast ration >7 and to pass Google's usability rating with an AAA.
If you have any suggestions feel free to mention them.
Before After
Tip: You can quickly switch the Browser View to Dark-Mode or Light-Mode by using the Developer Options: Just don't use the auomatic conversion from the Browser as that will replace all CSS.