Hi there,
I am using Sphinx 1.8.2 within a Canopy environment (running Python 3.5.2)
and the readthedocs theme. I am trying to add custom styling using CSS to
my HTML output using a file custom.css inside a _static folder and the make
html command. I am able to get custom styles, but when I make changes to
the CSS, they do not get propagated through to the output _build folder.
(Seemingly related to known Sphinx issue 2090
<https://github.com/sphinx-doc/sphinx/issues/2090>).
In my attempt to fix this problem, I have tried multiple variations on
importing CSS which I found through various sources (e.g.,
StackExchange)... I have added the following to my conf.py, which combines
two methods of importing CSS:
html_static_path = ['_static']
html_context = {
'css_files': ['custom.css'],
}
def setup(app):
app.add_stylesheet('custom.css')
I have also added two _templates files, page.html:
{% extends "!page.html" %}
{% set css_files = css_files + ["_static/custom.css"] %}
as well as layout.html:
{# layout.html #}
{# Import the theme's layout. #}
{% extends "!layout.html" %}
{% set css_files = css_files + ['_static/style.css'] %}
However, custom.css only seems to be updated to the output folder when I
make changes to conf.py (or presumably the .rst file - I'm not editing my
rst at this time, so I am unsure about this) - as tested by making large
obvious colour changes to certain elements and comparing custom.css files.
Obviously a workaround is to update the output CSS manually, but it would
be nice to understand why this is not working.
--
You received this message because you are subscribed to the Google Groups
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.