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

// Inline and block code styles
code,
pre {
9
  font-family: @font-family-monospace;
Mark Otto's avatar
Mark Otto committed
10
}
11
12

// Inline code
Mark Otto's avatar
Mark Otto committed
13
code {
14
  padding: 2px 4px;
15
16
17
  font-size: 90%;
  color: #c7254e;
  background-color: #f9f2f4;
18
  white-space: nowrap;
19
  border-radius: 4px;
Mark Otto's avatar
Mark Otto committed
20
}
21
22

// Blocks of code
Mark Otto's avatar
Mark Otto committed
23
24
pre {
  display: block;
25
26
  padding: ((@line-height-computed - 1) / 2);
  margin: 0 0 (@line-height-computed / 2);
27
  font-size: (@font-size-base - 1); // 14px to 13px
28
  line-height: @line-height-base;
Jacob Thornton's avatar
Jacob Thornton committed
29
30
  word-break: break-all;
  word-wrap: break-word;
31
  color: @gray-dark;
Mark Otto's avatar
Mark Otto committed
32
  background-color: #f5f5f5;
33
  border: 1px solid #ccc; // IE8 fallback
Mark Otto's avatar
Mark Otto committed
34
  border: 1px solid rgba(0,0,0,.15);
35
  border-radius: @border-radius-base;
Mark Otto's avatar
Mark Otto committed
36
37
38

  // Make prettyprint styles more spaced out for readability
  &.prettyprint {
39
    margin-bottom: @line-height-computed;
Mark Otto's avatar
Mark Otto committed
40
41
42
43
44
  }

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

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