code.less 1.16 KB
Newer Older
1
2
3
4
//
// Code (inline and blocK)
// --------------------------------------------------

Mark Otto's avatar
Mark Otto committed
5
6
7
8
9
10

// Inline and block code styles
code,
pre {
  padding: 0 3px 2px;
  #font > #family > .monospace;
11
  font-size: @baseFontSize - 2;
Mark Otto's avatar
Mark Otto committed
12
  color: @grayDark;
13
  border-radius: 3px;
Mark Otto's avatar
Mark Otto committed
14
}
15
16

// Inline code
Mark Otto's avatar
Mark Otto committed
17
code {
18
  padding: 2px 4px;
Mark Otto's avatar
Mark Otto committed
19
20
21
22
  color: #d14;
  background-color: #f7f7f9;
  border: 1px solid #e1e1e8;
}
23
24

// Blocks of code
Mark Otto's avatar
Mark Otto committed
25
26
27
28
pre {
  display: block;
  padding: (@baseLineHeight - 1) / 2;
  margin: 0 0 @baseLineHeight / 2;
29
  font-size: @baseFontSize - 1; // 14px to 13px
Mark Otto's avatar
Mark Otto committed
30
  line-height: @baseLineHeight;
Jacob Thornton's avatar
Jacob Thornton committed
31
32
33
34
  word-break: break-all;
  word-wrap: break-word;
  white-space: pre;
  white-space: pre-wrap;
Mark Otto's avatar
Mark Otto committed
35
  background-color: #f5f5f5;
36
  border: 1px solid #ccc; // IE8 fallback
Mark Otto's avatar
Mark Otto committed
37
  border: 1px solid rgba(0,0,0,.15);
38
  border-radius: 4px;
Mark Otto's avatar
Mark Otto committed
39
40
41
42
43
44
45
46
47

  // Make prettyprint styles more spaced out for readability
  &.prettyprint {
    margin-bottom: @baseLineHeight;
  }

  // Account for some code outputs that place code tags in pre tags
  code {
    padding: 0;
48
    color: inherit;
Mark Otto's avatar
Mark Otto committed
49
    background-color: transparent;
50
    border: 0;
Mark Otto's avatar
Mark Otto committed
51
52
  }
}
53
54
55
56
57
58

// Enable scrollable blocks of code
.pre-scrollable {
  max-height: 340px;
  overflow-y: scroll;
}