mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
Fix kbd tag HTML rendering
Commit c921c124e
(docs: use canonical key names in :kbd: tags, 2024-04-13)
removed the box highlighting from elements like :kbd:`ctrl-c`.
This is because Sphinx for some reason converts this into
<kbd>
<kbd>ctrl</kbd>
-
<kbd>c</kbd>
</kbd>
which results in duplicate boxes.
(See https://github.com/sphinx-doc/sphinx/issues/7530)
Our current style looks a bit ugly (it's
definitely worse than github's rendering at
https://github.com/fish-shell/fish-shell/blob/master/CHANGELOG.rst).
Let's restore the old style but make sure to only apply it only to the
outermost kbd element.
While at it, use the same monospace font as for inline code.
This commit is contained in:
parent
4c43819d32
commit
d829a99977
1 changed files with 7 additions and 3 deletions
|
@ -439,7 +439,7 @@ code {
|
|||
margin-right: 3px;
|
||||
}
|
||||
|
||||
tt, code, pre, dl > dt span ~ em, #synopsis p, #synopsis code, .command, button {
|
||||
tt, code, kbd, pre, dl > dt span ~ em, #synopsis p, #synopsis code, .command, button {
|
||||
/* Pick a monospace font.
|
||||
ui-monospace is the monospace version of system-ui - the system's monospace font.
|
||||
Unfortunately it's barely supported anywhere (at time of writing only Safari does!),
|
||||
|
@ -693,8 +693,12 @@ div.documentwrapper {
|
|||
/* Color based on the Generic.Prompt (.gp) class from pygments.css. */
|
||||
.prompt { color: #8f7902; }
|
||||
|
||||
kbd {
|
||||
kbd.compound, :not(kbd.compound) > kbd {
|
||||
background-color: var(--td-background);
|
||||
border: 1px solid;
|
||||
border-color: var(--sidebar-border-color);
|
||||
border-radius: .2em;
|
||||
padding: 0.1em 0.3em;
|
||||
}
|
||||
|
||||
div.body a {
|
||||
|
@ -728,7 +732,7 @@ div.body a {
|
|||
box-shadow: 0 0 5px 1px #000;
|
||||
}
|
||||
|
||||
kbd {
|
||||
kbd.compound, :not(kbd.compound) > kbd {
|
||||
box-shadow: 0.1em 0.1em 0.2em rgba(100,100,100,0.1);
|
||||
color: #FFF;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue