Skip to content

Commit f8df8ed

Browse files
authored
Merge pull request #1906 from brettchalupa/kbd-styles-1813
Add styles for <kbd> elements
2 parents a8c37ce + 79c159d commit f8df8ed

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

src/theme/css/general.css

+14-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ body {
2222
}
2323

2424
code {
25-
font-family: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace !important;
26-
font-size: 0.875em; /* please adjust the ace font size accordingly in editor.js */
25+
font-family: var(--mono-font) !important;
26+
font-size: var(--code-font-size);
2727
}
2828

2929
/* make long words/inline code not x overflow */
@@ -148,6 +148,18 @@ blockquote {
148148
border-bottom: .1em solid var(--quote-border);
149149
}
150150

151+
kbd {
152+
background-color: var(--table-border-color);
153+
border-radius: 4px;
154+
border: solid 1px var(--theme-popup-border);
155+
box-shadow: inset 0 -1px 0 var(--theme-hover);
156+
display: inline-block;
157+
font-size: var(--code-font-size);
158+
font-family: var(--mono-font);
159+
line-height: 10px;
160+
padding: 4px 5px;
161+
vertical-align: middle;
162+
}
151163

152164
:not(.footnote-definition) + .footnote-definition,
153165
.footnote-definition + :not(.footnote-definition) {

src/theme/css/variables.css

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
--page-padding: 15px;
77
--content-max-width: 750px;
88
--menu-bar-height: 50px;
9+
--mono-font: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace;
10+
--code-font-size: 0.875em /* please adjust the ace font size accordingly in editor.js */
911
}
1012

1113
/* Themes */

test_book/src/individual/mixed.md

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ fn main(){
2727
}
2828
```
2929

30+
<kbd>Ctrl</kbd> + <kbd>S</kbd> saves a file.
31+
3032
A random image sprinkled in between
3133

3234
![16x16 rust-lang logo](http://rust-lang.org/logos/rust-logo-16x16.png)
@@ -41,6 +43,7 @@ A random image sprinkled in between
4143
2. be
4244
3. `put`
4345
4. here?
46+
5. **<kbd>Ctrl</kbd> + <kbd>S</kbd> saves a file.**
4447

4548
| col1 | col2 | col 3 | col 4 | col 5 | col 6 |
4649
| ---- | ---- | ----- | ----- | ----- | ----- |

0 commit comments

Comments
 (0)