Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 1 | // |
| 2 | // Code (inline and block) |
| 3 | // -------------------------------------------------- |
| 4 | |
| 5 | // Inline and block code styles |
| 6 | code, |
| 7 | kbd, |
| 8 | pre, |
| 9 | samp { |
| 10 | font-family: $font-family-monospace; |
| 11 | } |
| 12 | |
| 13 | // Inline code |
| 14 | code { |
| 15 | padding: 2px 4px; |
| 16 | font-size: 90%; |
| 17 | color: $code-color; |
| 18 | background-color: $code-bg; |
| 19 | border-radius: $border-radius-base; |
| 20 | } |
| 21 | |
| 22 | // User input typically entered via keyboard |
| 23 | kbd { |
| 24 | padding: 2px 4px; |
| 25 | font-size: 90%; |
| 26 | color: $kbd-color; |
| 27 | background-color: $kbd-bg; |
| 28 | border-radius: $border-radius-small; |
| 29 | box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); |
| 30 | |
| 31 | kbd { |
| 32 | padding: 0; |
| 33 | font-size: 100%; |
| 34 | font-weight: bold; |
| 35 | box-shadow: none; |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | // Blocks of code |
| 40 | pre { |
| 41 | display: block; |
| 42 | padding: (($line-height-computed - 1) / 2); |
| 43 | margin: 0 0 ($line-height-computed / 2); |
| 44 | font-size: ($font-size-base - 1); // 14px to 13px |
| 45 | line-height: $line-height-base; |
| 46 | word-break: break-all; |
| 47 | word-wrap: break-word; |
| 48 | color: $pre-color; |
| 49 | background-color: $pre-bg; |
| 50 | border: 1px solid $pre-border-color; |
| 51 | border-radius: $border-radius-base; |
| 52 | |
| 53 | // Account for some code outputs that place code tags in pre tags |
| 54 | code { |
| 55 | padding: 0; |
| 56 | font-size: inherit; |
| 57 | color: inherit; |
| 58 | white-space: pre-wrap; |
| 59 | background-color: transparent; |
| 60 | border-radius: 0; |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | // Enable scrollable blocks of code |
| 65 | .pre-scrollable { |
| 66 | max-height: $pre-scrollable-max-height; |
| 67 | overflow-y: scroll; |
| 68 | } |