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

Optional dark theme #89

Open
johnthagen opened this issue Dec 7, 2020 · 25 comments
Open

Optional dark theme #89

johnthagen opened this issue Dec 7, 2020 · 25 comments

Comments

@johnthagen
Copy link
Contributor

It would be really neat if there was a configuration option to enable a dark mode (light text on a dark background). This would enable producing docs that looks like: https://fastapi.tiangolo.com/

Screen Shot 2020-12-07 at 9 15 21 AM

@bashtage
Copy link
Owner

Whenever I get around to updating to the latest Material for MkDocs this should be possible.

@bashtage
Copy link
Owner

Happy to accept PRs that do the sync 👍

@johnthagen
Copy link
Contributor Author

johnthagen commented Jan 12, 2021

For reference, the dark theme scheme seems to be called slate and can be enabled in Material for MkDocs as shown here: https://squidfunk.github.io/mkdocs-material-insiders/setup/changing-the-colors/#color-palette-toggle

theme:
  palette:
    scheme: slate
...

The toggle at the top of the page will toggle slate on and off for their example application.

@axsaucedo
Copy link

axsaucedo commented Feb 21, 2021

+1 I would be absolutely keen for this

If there is a CSS override I would also be keen to explore - I have opened #95 which proposes to explore this.

@johnthagen is this more of a general comment or is this something that can be enabled in the sphinx-material theme? The reason why I am asking is because if there is a way to enable it currently in a project using sphinx-material that would be really useful

@johnthagen
Copy link
Contributor Author

@axsaucedo This is more of a general feature request that I think would be a really great addition to this project. I don't know how to enable this currently.

@bashtage
Copy link
Owner

Once I sync with material mkdocs (hopefully in the next couple of months) this should become available.

@bashtage
Copy link
Owner

This isn't in this project because slate wasn't a color in material mkdocs when I initially wrote the project.

@jbms
Copy link

jbms commented Feb 26, 2021

I attempted to look into updating to sync in changes from material mkdocs. However, it isn't at all clear how to do that. Can you describe the process by which you derived this package from the mkdocs package?

@jbms
Copy link

jbms commented Mar 1, 2021

I spent some time rebasing this package on mkdocs-material HEAD. I discarded the existing css and javascript since it isn't really in editable form anyway, and just used the original scss/typescript sources from mkdocs-material with only minimal modifications. I also kept the jinja html templates as close to the mkdocs ones as possible. That way keeping up to date with it in the future should be a lot easier. I have everything working about 90% now, including the dark theme support. I will send out a pull request shortly, once I've cleaned up the build scripts a bit more.

@johnthagen
Copy link
Contributor Author

@jbms This sounds very exciting! Thanks!

@bashtage
Copy link
Owner

bashtage commented Mar 1, 2021

@jbms This is more or less the way the original version came to be, so this makes sense. Looking forward to seeing and trying the PR.

@jbms
Copy link

jbms commented Mar 3, 2021

@johnthagen @bashtage See pull request #96

@Cryptex-github
Copy link

Any update on this.

@ooliver1
Copy link

ooliver1 commented Dec 5, 2021

doesnt seem like it

@jbms
Copy link

jbms commented Dec 5, 2021

@2bndy and I are now developing a fork of this theme (based on newer mkdocs-material), which includes dark mode, separately in https://github.com/jbms/sphinx-immaterial.

@baco
Copy link

baco commented Oct 2, 2022

Once I sync with material mkdocs (hopefully in the next couple of months) this should become available.

Any news on this feature @bashtage?

@vsoch
Copy link

vsoch commented Jan 9, 2023

Ping! Any updates here?

@jermanuts
Copy link

There's a fork with the desired option! https://github.com/jbms/sphinx-immaterial

@ooliver1
Copy link

Is there any reason you chose a fork instead of contributing upstream? The first reply in this thread suggested they would be welcome to accept a PR.

@baco
Copy link

baco commented Apr 18, 2023

@ooliver1 well, for starters, jermanuts is only mentioning the fork, he's not the author of the fork, there's nothing bad with that. I, for myself, can not code in JS, but would like to include documentation with Sphinx in my Python projects instead. I would go for the fork.

Second, this project seems to be abandoned (no commits on the entire 2022). No answers from the developers whatsoever. Furthermore, if you go through the history of this issue thread, there's a PR (ignored for two years now), from the author of the fork, trying to contribute back in the days to this project.

When you get ignored that many times, forks arise. But there's no one to blame here, perhaps bashtage just got tired of maintaining this project, and that's OK. And obviously, the community got tired of waiting and took action, and that's OK too.

I don't think jermanuts deserves to be questioned, in public, for proposing the fork.

@bashtage
Copy link
Owner

I would be happy to move the project on to someone who wants to work on it. I don't have the time or the inclination to maintain it, and especially to improve it. When I started it I took the material theme post rendering and so integrating changes like color variants was not easy.

@bashtage
Copy link
Owner

As for the fork, it is OSS. Forking and improving is essential (precisely for cases like this, among other reasons).

@bashtage
Copy link
Owner

If I can get statsmodels and my own repos to work well with immaterial, then I'll probably move to it in the next release and officially mothball this. If @jbms is interested in the name on PyPI, please get in touch.

@jbms
Copy link

jbms commented Apr 18, 2023

I think at this point changing the sphinx-immaterial package name would just create confusion.

@bashtage
Copy link
Owner

I agree, but just wanted to offer it in case.

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

Successfully merging a pull request may close this issue.

9 participants