Skip to content

Commit 154f273

Browse files
authored
[fix] don't append CSS files to the end of html_static_path list (#153)
html_static_path is a list of paths that contain custom static files. They are copied to the output’s _static directory **after** the theme’s static files, so a file named default.css will overwrite the theme’s default.css [1] Without this patch a tabs.css can't be overwritten by the `conf.py` file: html_static_path = [ 'static/tabs.css', ] The /static folder from sphinx-tabs needs to be added in front of html_static_path since the last item in the list will be written last to /_static. [1] https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_static_path Signed-off-by: Markus Heiser <[email protected]>
1 parent 53b6a63 commit 154f273

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sphinx_tabs/tabs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def setup(app):
355355
static_dir = Path(__file__).parent / "static"
356356
app.connect(
357357
"builder-inited",
358-
(lambda app: app.config.html_static_path.append(static_dir.as_posix())),
358+
(lambda app: app.config.html_static_path.insert(0, static_dir.as_posix())),
359359
)
360360
app.connect("config-inited", update_config)
361361
app.connect("html-page-context", update_context)

0 commit comments

Comments
 (0)