_code.scss 942 Bytes
Newer Older
1
// Inline code
Mark Otto's avatar
Mark Otto committed
2
code {
3
  @include font-size($code-font-size);
Mark Otto's avatar
Mark Otto committed
4
  color: $code-color;
5
  word-break: break-word;
6
7
8
9
10

  // Streamline the style when inside anchors to avoid broken underline and more
  a > & {
    color: inherit;
  }
Mark Otto's avatar
Mark Otto committed
11
}
12

13
14
// User input typically entered via keyboard
kbd {
15
  padding: $kbd-padding-y $kbd-padding-x;
16
  @include font-size($kbd-font-size);
Mark Otto's avatar
Mark Otto committed
17
18
19
  color: $kbd-color;
  background-color: $kbd-bg;
  @include border-radius($border-radius-sm);
20

21
  kbd {
22
    padding: 0;
23
    @include font-size(100%);
24
    font-weight: $nested-kbd-font-weight;
25
  }
26
27
}

28
// Blocks of code
Mark Otto's avatar
Mark Otto committed
29
30
pre {
  display: block;
31
  @include font-size($code-font-size);
Mark Otto's avatar
Mark Otto committed
32
  color: $pre-color;
Mark Otto's avatar
Mark Otto committed
33
34
35

  // Account for some code outputs that place code tags in pre tags
  code {
36
    @include font-size(inherit);
37
    color: inherit;
38
    word-break: normal;
Mark Otto's avatar
Mark Otto committed
39
40
  }
}
41
42
43

// Enable scrollable blocks of code
.pre-scrollable {
Mark Otto's avatar
Mark Otto committed
44
  max-height: $pre-scrollable-max-height;
45
  overflow-y: scroll;
Mark Otto's avatar
Mark Otto committed
46
}