Closed N-Wouda closed 11 months ago
I suspect this has something to do with the fact that we don't inherit CSS from a builtin sphinx theme... Looking at the docutils example, there's the following CSS rule:
div.line-block div.line-block {
margin-left: 1.5em;
}
which provides the indent in HTML.
Digging into whatever else we're missing CSS-wise in the basic theme (a commonly inherited sphinx theme), I also see the following CSS rules:
.line-block {
display: block;
margin-top: 1em;
margin-bottom: 1em;
}
.line-block .line-block {
margin-top: 0;
margin-bottom: 0;
margin-left: 1.5em;
}
I don't think it would be harmful to other HTML elements if we add this CSS to our sphinx.scss file, but I would prefer a more specific selector (like div.line-block
).
@N-Wouda Thanks for reporting this! Would you like to submit a PR with
div.line-block {
display: block;
}
div.line-block div.line-block {
margin-left: 1.5em;
}
added to our src/assets/stylesheets/main/_sphinx.scss file?
Certainly! Thanks for investigating - I really wasn't sure where to begin. I'll open a PR in a minute!
fix now available in v0.11.6
Ah great! I'll update my use case to 0.11.6 right now. Let's hope for the best.
Works beautifully:
Thanks @2bndy5!
Hello, thanks for the great work on making this theme available to Sphinx users! I've recently moved over to using sphinx-immaterial and noticed that the line block markup does not preserve indent. This can be seen in the documentation:
I expect this to render as
like in the docutils example.