type.less 6.07 KB
Newer Older
1
2
3
//
// Typography
// --------------------------------------------------
Jacob Thornton's avatar
Jacob Thornton committed
4
5


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Headings
// -------------------------

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: @headings-font-family;
  font-weight: @headings-font-weight;
  line-height: @headings-line-height;
  color: @headings-color;

  small,
  .small {
    font-weight: normal;
    line-height: 1;
    color: @headings-small-color;
  }
}

24
25
26
h1, .h1,
h2, .h2,
h3, .h3 {
27
28
29
30
31
32
33
34
  margin-top: @line-height-computed;
  margin-bottom: (@line-height-computed / 2);

  small,
  .small {
    font-size: 65%;
  }
}
35
36
37
h4, .h4,
h5, .h5,
h6, .h6 {
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
  margin-top: (@line-height-computed / 2);
  margin-bottom: (@line-height-computed / 2);

  small,
  .small {
    font-size: 75%;
  }
}

h1, .h1 { font-size: @font-size-h1; }
h2, .h2 { font-size: @font-size-h2; }
h3, .h3 { font-size: @font-size-h3; }
h4, .h4 { font-size: @font-size-h4; }
h5, .h5 { font-size: @font-size-h5; }
h6, .h6 { font-size: @font-size-h6; }


Mark Otto's avatar
Mark Otto committed
55
56
// Body text
// -------------------------
Jacob Thornton's avatar
Jacob Thornton committed
57
58

p {
Mark Otto's avatar
Mark Otto committed
59
  margin: 0 0 (@line-height-computed / 2);
Jacob Thornton's avatar
Jacob Thornton committed
60
}
61

62
.lead {
Mark Otto's avatar
Mark Otto committed
63
  margin-bottom: @line-height-computed;
64
  font-size: floor((@font-size-base * 1.15));
65
  font-weight: 200;
66
  line-height: 1.4;
67

Zlatan Vasović's avatar
Zlatan Vasović committed
68
  @media (min-width: @screen-sm-min) {
69
70
    font-size: (@font-size-base * 1.5);
  }
71
}
Jacob Thornton's avatar
Jacob Thornton committed
72

Mark Otto's avatar
Mark Otto committed
73

74
75
76
// Emphasis & misc
// -------------------------

77
// Ex: 14px base font * 85% = about 12px
Mark Otto's avatar
Mark Otto committed
78
79
small,
.small  { font-size: 85%; }
80

81
// Undo browser default styling
82
cite    { font-style: normal; }
83

84
85
86
87
88
89
90
// Alignment
.text-left           { text-align: left; }
.text-right          { text-align: right; }
.text-center         { text-align: center; }
.text-justify        { text-align: justify; }

// Contextual colors
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
.text-muted {
  color: @text-muted;
}
.text-primary {
  color: @brand-primary;
  &:hover {
    color: darken(@brand-primary, 10%);
  }
}
.text-warning {
  color: @state-warning-text;
  &:hover {
    color: darken(@state-warning-text, 10%);
  }
}
.text-danger {
  color: @state-danger-text;
  &:hover {
    color: darken(@state-danger-text, 10%);
  }
}
.text-success {
  color: @state-success-text;
  &:hover {
    color: darken(@state-success-text, 10%);
  }
}
.text-info {
  color: @state-info-text;
  &:hover {
    color: darken(@state-info-text, 10%);
  }
}
Mark Otto's avatar
Mark Otto committed
124

125
126
127
128
// Contextual backgrounds
// For now we'll leave these alongside the text classes until v4 when we can
// safely shift things around (per SemVer rules).
.bg-primary {
Chris Rebert's avatar
Chris Rebert committed
129
  // Given the contrast here, this is the only class to have its color inverted
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
  // automatically.
  color: #fff;
  background-color: @brand-primary;
  a&:hover {
    background-color: darken(@brand-primary, 10%);
  }
}
.bg-warning {
  background-color: @state-warning-bg;
  a&:hover {
    background-color: darken(@state-warning-bg, 10%);
  }
}
.bg-danger {
  background-color: @state-danger-bg;
  a&:hover {
    background-color: darken(@state-danger-bg, 10%);
  }
}
.bg-success {
  background-color: @state-success-bg;
  a&:hover {
    background-color: darken(@state-success-bg, 10%);
  }
}
.bg-info {
  background-color: @state-info-bg;
  a&:hover {
    background-color: darken(@state-info-bg, 10%);
  }
}
161

162

163
// Page header
Mark Otto's avatar
Mark Otto committed
164
165
// -------------------------

166
.page-header {
Mark Otto's avatar
Mark Otto committed
167
168
  padding-bottom: ((@line-height-computed / 2) - 1);
  margin: (@line-height-computed * 2) 0 @line-height-computed;
syed's avatar
syed committed
169
  border-bottom: 1px solid @page-header-border-color;
170
171
172
}


Mark Otto's avatar
Mark Otto committed
173
174
// Lists
// --------------------------------------------------
Jacob Thornton's avatar
Jacob Thornton committed
175
176

// Unordered and Ordered lists
177
178
ul,
ol {
Mark Otto's avatar
Mark Otto committed
179
180
  margin-top: 0;
  margin-bottom: (@line-height-computed / 2);
liuyl's avatar
liuyl committed
181
  ul,
182
  ol {
liuyl's avatar
liuyl committed
183
184
    margin-bottom: 0;
  }
Jacob Thornton's avatar
Jacob Thornton committed
185
}
Mark Otto's avatar
Mark Otto committed
186

187
// List options
188

189
// Unstyled keeps list items block level, just removes default browser padding and list-style
190
.list-unstyled {
191
  padding-left: 0;
192
  list-style: none;
Jacob Thornton's avatar
Jacob Thornton committed
193
}
194

195
196
197
// Inline turns list items into inline-block
.list-inline {
  .list-unstyled();
198

199
200
201
202
  > li {
    display: inline-block;
    padding-left: 5px;
    padding-right: 5px;
203
204
205
206

    &:first-child {
      padding-left: 0;
    }
207
  }
208
}
Jacob Thornton's avatar
Jacob Thornton committed
209
210
211

// Description Lists
dl {
212
  margin-top: 0; // Remove browser default
Mark Otto's avatar
Mark Otto committed
213
  margin-bottom: @line-height-computed;
214
215
216
}
dt,
dd {
217
  line-height: @line-height-base;
218
219
220
221
222
}
dt {
  font-weight: bold;
}
dd {
223
  margin-left: 0; // Undo browser default
Jacob Thornton's avatar
Jacob Thornton committed
224
}
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241

// Horizontal description lists
//
// Defaults to being stacked without any of the below styles applied, until the
// grid breakpoint is reached (default of ~768px).

@media (min-width: @grid-float-breakpoint) {
  .dl-horizontal {
    dt {
      float: left;
      width: (@component-offset-horizontal - 20);
      clear: left;
      text-align: right;
      .text-overflow();
    }
    dd {
      margin-left: @component-offset-horizontal;
242
      &:extend(.clearfix all); // Clear the floated `dt` if an empty `dd` is present
243
    }
244
245
  }
}
Jacob Thornton's avatar
Jacob Thornton committed
246

247
// MISC
248
// ----
Jacob Thornton's avatar
Jacob Thornton committed
249

250
// Abbreviations and acronyms
251
abbr[title],
Zlatan Vasović's avatar
Zlatan Vasović committed
252
// Add data-* attribute to help out our tooltip plugin, per https://github.com/twbs/bootstrap/issues/5257
253
abbr[data-original-title] {
254
  cursor: help;
syed's avatar
syed committed
255
  border-bottom: 1px dotted @abbr-border-color;
256
}
257
.initialism {
258
259
260
  font-size: 90%;
  text-transform: uppercase;
}
261

Jacob Thornton's avatar
Jacob Thornton committed
262
263
// Blockquotes
blockquote {
Mark Otto's avatar
Mark Otto committed
264
265
  padding: (@line-height-computed / 2) @line-height-computed;
  margin: 0 0 @line-height-computed;
syed's avatar
syed committed
266
  border-left: 5px solid @blockquote-border-color;
Jacob Thornton's avatar
Jacob Thornton committed
267
  p {
268
    font-size: (@font-size-base * 1.25);
Jacob Thornton's avatar
Jacob Thornton committed
269
  }
270
271
272
  p:last-child {
    margin-bottom: 0;
  }
273
274
275
276

  // Deprecating small and .small for v3.1
  // Context: https://github.com/twbs/bootstrap/issues/11660
  footer,
277
278
  small,
  .small {
Jacob Thornton's avatar
Jacob Thornton committed
279
    display: block;
280
    line-height: @line-height-base;
syed's avatar
syed committed
281
    color: @blockquote-small-color;
Jacob Thornton's avatar
Jacob Thornton committed
282
    &:before {
Zlatan Vasović's avatar
Zlatan Vasović committed
283
      content: '\2014 \00A0'; // EM DASH, NBSP
Jacob Thornton's avatar
Jacob Thornton committed
284
285
    }
  }
286
287
288

  // Float right with text-align: right
  &.pull-right {
289
    padding-right: 15px;
Jacob Thornton's avatar
Jacob Thornton committed
290
    padding-left: 0;
syed's avatar
syed committed
291
    border-right: 5px solid @blockquote-border-color;
Jacob Thornton's avatar
Jacob Thornton committed
292
    border-left: 0;
293
    p,
294
295
    small,
    .small {
296
297
      text-align: right;
    }
298
299
    small,
    .small {
300
301
302
303
      &:before {
        content: '';
      }
      &:after {
Zlatan Vasović's avatar
Zlatan Vasović committed
304
        content: '\00A0 \2014'; // NBSP, EM DASH
305
306
      }
    }
307
  }
Jacob Thornton's avatar
Jacob Thornton committed
308
309
}

310
// Quotes
311
blockquote:before,
312
313
314
315
blockquote:after {
  content: "";
}

Jacob Thornton's avatar
Jacob Thornton committed
316
317
// Addresses
address {
Mark Otto's avatar
Mark Otto committed
318
  margin-bottom: @line-height-computed;
319
  font-style: normal;
320
  line-height: @line-height-base;
Jacob Thornton's avatar
Jacob Thornton committed
321
}