Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add kbd style tag to main.css in rustdoc #46938

Merged
merged 4 commits into from
Jan 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/librustdoc/html/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,22 @@ r##"<!DOCTYPE html>
<h2>Keyboard Shortcuts</h2>

<dl>
<dt>?</dt>
<dt><kbd>?</kbd></dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dt><kbd>S</kbd></dt>
<dd>Focus the search field</dd>
<dt></dt>
<dt><kbd>↑</kbd></dt>
<dd>Move up in search results</dd>
<dt></dt>
<dt><kbd>↓</kbd></dt>
<dd>Move down in search results</dd>
<dt></dt>
<dt><kbd>↹</kbd></dt>
<dd>Switch tab</dd>
<dt>&#9166;</dt>
<dt><kbd>&#9166;</kbd></dt>
<dd>Go to active search result</dd>
<dt style="width:31px;">+ / -</dt>
<dd>Collapse/expand all sections</dd>
<dt><kbd>+</kbd></dt>
<dd>Expand all sections</dd>
<dt><kbd>-</kbd></dt>
<dd>Collapse all sections</dd>
</dl>
</div>

Expand Down
18 changes: 12 additions & 6 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -585,18 +585,13 @@ body.blur > :not(#help) {
flex: 0 0 auto;
box-shadow: 0 0 6px rgba(0,0,0,.2);
width: 550px;
height: 354px;
height: auto;
border: 1px solid;
}
#help dt {
float: left;
border-radius: 4px;
border: 1px solid;
width: 23px;
text-align: center;
clear: left;
display: block;
margin-top: -1px;
}
#help dd { margin: 5px 35px; }
#help .infos { padding-left: 0; }
Expand Down Expand Up @@ -1107,3 +1102,14 @@ h3.important {
left: -42px;
margin-top: 2px;
}

kbd {
display: inline-block;
padding: 3px 5px;
font: 15px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
vertical-align: middle;
border: solid 1px;
border-radius: 3px;
box-shadow: inset 0 -1px 0;
}
13 changes: 8 additions & 5 deletions src/librustdoc/html/static/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,6 @@ a.test-arrow {
border-color: #bfbfbf;;
}

#help dt {
border-color: #bfbfbf;
background: #fff;
}

.since {
color: grey;
}
Expand Down Expand Up @@ -343,3 +338,11 @@ pre.ignore:hover, .information:hover + pre.ignore {
border-right-color: #000;
}
}

kbd {
color: #444d56;
background-color: #fafbfc;
border-color: #d1d5da;
border-bottom-color: #c6cbd1;
box-shadow-color: #c6cbd1;
}