Allow specifying multiple CSS files in themes (#10465)

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
This commit is contained in:
Takeshi KOMIYA
2022-07-17 20:27:43 +09:00
committed by GitHub
parent 8f893a625d
commit e7fc03bce2
10 changed files with 59 additions and 12 deletions

View File

@@ -0,0 +1,3 @@
[theme]
inherit = basic
stylesheet = mytheme.css, extra.css

View File

@@ -0,0 +1,2 @@
html_theme_path = ['_themes']
html_theme = 'mytheme'

View File

@@ -0,0 +1,2 @@
test-build-html-theme-having-multiple-stylesheets
=================================================

View File

@@ -1782,3 +1782,12 @@ def test_theme_options_with_override(app, status, warning):
result = (app.outdir / '_static' / 'documentation_options.js').read_text(encoding='utf8')
assert 'NAVIGATION_WITH_KEYS: true' in result
assert 'ENABLE_SEARCH_SHORTCUTS: false' in result
@pytest.mark.sphinx('html', testroot='build-html-theme-having-multiple-stylesheets')
def test_theme_having_multiple_stylesheets(app):
app.build()
content = (app.outdir / 'index.html').read_text(encoding='utf-8')
assert '<link rel="stylesheet" type="text/css" href="_static/mytheme.css" />' in content
assert '<link rel="stylesheet" type="text/css" href="_static/extra.css" />' in content