I frequently put images in-line with text to indicate icons/buttons in documentation. They never look right unless correctly vertically aligned.
In HTML, with the "book" theme, it looks like this:

(Not perfect, and this is always a headache with Sphinx, but close enough.)
With SimplePDF, the same document section looks like this:

The images are defined something like this:
.. |ic_foo| image:: images/ic_foo.svg
:align: middle
:width: 32
And are then used in the text like this:
This is some text about clicking |ic_foo| to do stuff.
If I try replacing the "middle" alignment instruction with custom CSS, then I need "baseline" alignment to get the desired behavior in HTML and "center" alignment to get the same behavior in SimplePDF. Ideally both should behave the same. If this is not possible, then is there an easy way to make CSS do one thing for SimplePDF and another thing for HTML? (the CSS currently gets included with the html_css_files directive in the Sphinx configuration file.
I frequently put images in-line with text to indicate icons/buttons in documentation. They never look right unless correctly vertically aligned.
In HTML, with the "book" theme, it looks like this:
With SimplePDF, the same document section looks like this:

The images are defined something like this:
And are then used in the text like this:
If I try replacing the "middle" alignment instruction with custom CSS, then I need "baseline" alignment to get the desired behavior in HTML and "center" alignment to get the same behavior in SimplePDF. Ideally both should behave the same. If this is not possible, then is there an easy way to make CSS do one thing for SimplePDF and another thing for HTML? (the CSS currently gets included with the
html_css_filesdirective in the Sphinx configuration file.