Closed 12rambau closed 10 months ago
Since the text is customizable (even the font being used is customizable), I think the better solution is to put the colored bg color in a :before
pseudo element that won't affect the line height (too much) and encompass the text from descendor to ascendor (arbitrary of the font family used). This way people who enter a lower-case letter in their config don't get an unexpected capitol letter.
Probably somewhere in here:
https://github.com/jbms/sphinx-immaterial/blob/5756b7fabfde981e27a0cc1a3e9459bc897e9d7b/src/assets/stylesheets/main/_api.scss#L257-L263
This solution assumes that all uppercase letters (in English) have no descendors, but Q
actually does. Thus this won't fully resolve the issue:
using
object_description_options = [
("py:parameter", dict(toc_icon_class="data", toc_icon_text="Q")),
]
I have found that by changing the span element's display type to inline-table
, then we get something more universally desirable.
which was done with the following patch:
--- a/src/assets/stylesheets/main/_api.scss
+++ b/src/assets/stylesheets/main/_api.scss
@@ -239,7 +239,7 @@ $objinfo-icon-size: 16px;
}
.objinfo-icon {
- display: inline-block;
+ display: inline-table;
flex-shrink: 0;
width: $objinfo-icon-size;
height: $objinfo-icon-size;
This solution assumes that all uppercase letters (in English) have no descendors, but Q actually does. Thus this won't fully resolve the issue:
As you see I'm a fool ;-)
I rollback my changes and opt for your solution instead, it works like a charm !
Fix #289