-
Notifications
You must be signed in to change notification settings - Fork 200
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
Unable to inherit from sphinx-book-theme due to CSS hashes #373
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Heya, yeh this is a bit of a pain with regard to the sphinx set up for theme CSS: the CSS definitely needs to be hashed, since otherwise any changes to it do not get reflected when people load the page, due to browser caching (this issue was brought up numerous times before hashing was introduced), but sphinx obviously stipulates that the name needs to be static in the when adding arbitrary CSS in a sphinx extension, you can indeed dynamically write the css with a hashed file name (see e.g. https://github.com/executablebooks/sphinx-design/blob/9848dc5435ff19c38965a3ea91674ffc66cf2757/sphinx_design/extension.py#L75), but I'm not sure the way to do that with theme CSS stylesheet. |
Another approach would be to have a pradyunsg/furo@11dc2ee -- the way that's implemented assumes that it's |
Yeah I understand the need for the hash, but implementing it as a |
I opened up an issue to track the hashing idea specifically: #376 . That indeed looks like a useful pattern to follow. |
resolved by #397 |
Describe the problem
I am exploring making a new theme for Dask which inherits sphinx-book-theme. We have a bespoke theme because we have many projects which all use the same theme and we need to be able to apply CSS/layout changes broadly across all projects rather than including additional CSS on a project-per-project basis. We mainly just want to configure colours, logos and a top nav bar.
The challenge I am having is that according to the Sphinx docs we need to override the default CSS file in the
theme.conf
and then import it inside the CSS. We do this today with the RTD theme.However with sphinx-book-theme the CSS file is autogenerated and contains a hash and the URL in the
theme.conf
is populated via a Jinja template. This means we cannot make use of that CSS file from within our CSS file as the name changes unpredictably.Link to your repository or website
https://github.com/dask/dask-sphinx-theme
Steps to reproduce
sphinx_book_theme
sphinx-book-theme
CSS within the custom CSSsphinx_book_theme
CSS and see the name change and the include breakThe version of Python you're using
3.9
Your operating system
macos
Versions of your packages
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: