Skip to content

Commit

Permalink
DOC: Highlight literals a bit more
Browse files Browse the repository at this point in the history
The only style difference for literals is currently a monospace font.
This blends very much into surrounding text and makes it hard to read
the literals.

All other major themes (https://sphinx-themes.org/) use a background
for literals. It's a good idea to do the same in sphinx13. I've taken the
CSS from pydata-sphinx-theme, but I don't care too much about the actual
parameters as long as it stays visible but decent.
Note that I've limitied the background to `div.body` so that the background
is not applied in the sidebar. The sidebar entries are often single words
phrases and don't need a background. Actually, the backgound there would
be too cluttery.
  • Loading branch information
timhoffm committed Oct 2, 2024
1 parent 5ef3298 commit acadbe3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/_themes/sphinx13/static/sphinx13.css
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,13 @@ cite, code, tt {
letter-spacing: -0.02em;
}

div.body code.literal {
background-color: #f3f4f5;
border: 1px solid #d1d5da;
border-radius: 0.25rem;
padding: .1rem .2rem;
}

table.deprecated code.literal {
word-break: break-all;
}
Expand Down

0 comments on commit acadbe3

Please sign in to comment.