Skip to content

Commit 65c8f3e

Browse files
committed
Add <kbd> element styles to indicate user input via keyboard.
twbs/bootstrap#11193
1 parent 5eaa50d commit 65c8f3e

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

css/flat-ui.css

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,17 +431,26 @@ address {
431431
line-height: 1.72222;
432432
}
433433
code,
434-
kdb,
434+
kbd,
435435
pre,
436436
samp {
437437
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
438438
}
439439
code {
440-
font-size: 75%;
440+
padding: 2px 6px;
441+
font-size: 85%;
441442
color: #c7254e;
442443
background-color: #f9f2f4;
443444
border-radius: 4px;
444445
}
446+
kbd {
447+
padding: 2px 6px;
448+
font-size: 85%;
449+
color: #ffffff;
450+
background-color: #34495e;
451+
border-radius: 4px;
452+
box-shadow: none;
453+
}
445454
pre {
446455
padding: 8px;
447456
margin: 0 0 15px;

less/modules/code.less

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,31 @@
55

66
// Inline and block code styles
77
code,
8-
kdb,
8+
kbd,
99
pre,
1010
samp {
1111
font-family: @font-family-monospace;
1212
}
1313

1414
// Inline code
1515
code {
16-
font-size: 75%;
16+
padding: 2px 6px;
17+
font-size: 85%;
1718
color: @code-color;
1819
background-color: @code-bg;
1920
border-radius: @border-radius-base;
2021
}
2122

23+
// User input typically entered via keyboard
24+
kbd {
25+
padding: 2px 6px;
26+
font-size: 85%;
27+
color: @kbd-color;
28+
background-color: @kbd-bg;
29+
border-radius: @border-radius-base;
30+
box-shadow: none;
31+
}
32+
2233
// Blocks of code
2334
pre {
2435
padding: ((@line-height-computed - 6) / 3);

less/variables.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,9 @@
466466
@code-color: #c7254e;
467467
@code-bg: #f9f2f4;
468468

469+
@kbd-color: @inverse;
470+
@kbd-bg: @brand-primary;
471+
469472
@pre-bg: @inverse;
470473
@pre-color: inherit;
471474
@pre-border-color: mix(@brand-primary, @inverse, 12%);

0 commit comments

Comments
 (0)