_code.scss 1.04 KB
Newer Older
Mark Otto's avatar
Mark Otto committed
1
2
// Inline and block code styles
code,
Zlatan Vasović's avatar
Zlatan Vasović committed
3
kbd,
4
5
pre,
samp {
Mark Otto's avatar
Mark Otto committed
6
  font-family: $font-family-monospace;
Mark Otto's avatar
Mark Otto committed
7
}
8
9

// Inline code
Mark Otto's avatar
Mark Otto committed
10
code {
11
  font-size: $code-font-size;
Mark Otto's avatar
Mark Otto committed
12
  color: $code-color;
13
  word-break: break-word;
14
15
16
17
18

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

21
22
// User input typically entered via keyboard
kbd {
23
24
  padding: $kbd-padding-y $kbd-padding-x;
  font-size: $kbd-font-size;
Mark Otto's avatar
Mark Otto committed
25
26
27
  color: $kbd-color;
  background-color: $kbd-bg;
  @include border-radius($border-radius-sm);
28
  @include box-shadow($kbd-box-shadow);
29
30
31
32

  kbd {
    padding: 0;
    font-size: 100%;
33
    font-weight: $nested-kbd-font-weight;
Mark Otto's avatar
Mark Otto committed
34
    @include box-shadow(none);
35
  }
36
37
}

38
// Blocks of code
Mark Otto's avatar
Mark Otto committed
39
40
pre {
  display: block;
41
  font-size: $code-font-size;
Mark Otto's avatar
Mark Otto committed
42
  color: $pre-color;
Mark Otto's avatar
Mark Otto committed
43
44
45

  // Account for some code outputs that place code tags in pre tags
  code {
46
    font-size: inherit;
47
    color: inherit;
48
    word-break: normal;
Mark Otto's avatar
Mark Otto committed
49
50
  }
}
51
52
53

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