Skip to content

Commit

Permalink
doc: register theme overrides using add_stylesheet
Browse files Browse the repository at this point in the history
Instead of performing theme corrections using the 'css_files'
options, use the application instance's `add_stylesheet` instead.
This prevents issues where overriding the theme affects ReadTheDoc's
theme [1].

[1]: readthedocs/readthedocs.org#2116

Signed-off-by: James Knight <[email protected]>
  • Loading branch information
jdknight committed Mar 30, 2018
1 parent 2f32d2b commit 46a55a1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

html_context = {
'css_files': [ '_static/theme_overrides.css' ],
}

# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
Expand Down Expand Up @@ -162,5 +158,8 @@
'Miscellaneous'),
]

# append theme override
def setup(app):
app.add_stylesheet('theme_overrides.css')


0 comments on commit 46a55a1

Please sign in to comment.