]>
Commit | Line | Data |
---|---|---|
91e44d91 S |
1 | // Inline and block code styles |
2 | code, | |
3 | kbd, | |
4 | pre, | |
5 | samp { | |
6 | font-family: $font-family-monospace; | |
7 | } | |
8 | ||
9 | // Inline code | |
10 | code { | |
11 | padding: $code-padding-y $code-padding-x; | |
12 | font-size: $code-font-size; | |
13 | color: $code-color; | |
14 | background-color: $code-bg; | |
15 | @include border-radius($border-radius); | |
16 | ||
17 | // Streamline the style when inside anchors to avoid broken underline and more | |
18 | a > & { | |
19 | padding: 0; | |
20 | color: inherit; | |
21 | background-color: inherit; | |
22 | } | |
23 | } | |
24 | ||
25 | // User input typically entered via keyboard | |
26 | kbd { | |
27 | padding: $code-padding-y $code-padding-x; | |
28 | font-size: $code-font-size; | |
29 | color: $kbd-color; | |
30 | background-color: $kbd-bg; | |
31 | @include border-radius($border-radius-sm); | |
32 | @include box-shadow($kbd-box-shadow); | |
33 | ||
34 | kbd { | |
35 | padding: 0; | |
36 | font-size: 100%; | |
37 | font-weight: $nested-kbd-font-weight; | |
38 | @include box-shadow(none); | |
39 | } | |
40 | } | |
41 | ||
42 | // Blocks of code | |
43 | pre { | |
44 | display: block; | |
45 | margin-top: 0; | |
46 | margin-bottom: 1rem; | |
47 | font-size: $code-font-size; | |
48 | color: $pre-color; | |
49 | ||
50 | // Account for some code outputs that place code tags in pre tags | |
51 | code { | |
52 | padding: 0; | |
53 | font-size: inherit; | |
54 | color: inherit; | |
55 | background-color: transparent; | |
56 | border-radius: 0; | |
57 | } | |
58 | } | |
59 | ||
60 | // Enable scrollable blocks of code | |
61 | .pre-scrollable { | |
62 | max-height: $pre-scrollable-max-height; | |
63 | overflow-y: scroll; | |
64 | } |