_component-examples.scss 5.4 KB
Newer Older
1
2
3
4
//
// Grid examples
//

Mark Otto's avatar
Mark Otto committed
5
6
7
8
.bd-example-row {
  .row {
    margin-bottom: 1rem;

9
    > .col,
Mark Otto's avatar
Mark Otto committed
10
11
12
13
14
15
16
    > [class^="col-"] {
      padding-top: .75rem;
      padding-bottom: .75rem;
      background-color: rgba(86,61,124,.15);
      border: 1px solid rgba(86,61,124,.2);
    }
  }
17
18
19
20
21
22
23
24
25
26

  [class*="flex-items-"] {
    min-height: 6rem;
    background-color: rgba(255,0,0,.1);
  }
}

.bd-example-row-flex-cols .row {
  min-height: 10rem;
  background-color: rgba(255,0,0,.1);
27
28
29
}


Mark Otto's avatar
Mark Otto committed
30
31
32
33
34
//
// Container illustrations
//

.bd-example-container {
Mark Otto's avatar
Mark Otto committed
35
36
  min-width: 16rem;
  max-width: 25rem;
Mark Otto's avatar
Mark Otto committed
37
  margin-right: auto;
Mark Otto's avatar
Mark Otto committed
38
  margin-left: auto;
Mark Otto's avatar
Mark Otto committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
}

.bd-example-container-header {
  height: 3rem;
  margin-bottom: .5rem;
  background-color: lighten($brand-primary, 50%);
  border-radius: .25rem;
}

.bd-example-container-sidebar {
  float: right;
  width: 4rem;
  height: 8rem;
  background-color: lighten($brand-warning, 25%);
  border-radius: .25rem;
}

.bd-example-container-body {
  height: 8rem;
  margin-right: 4.5rem;
  background-color: lighten($bd-purple, 25%);
  border-radius: .25rem;
}

.bd-example-container-fluid {
Mark Otto's avatar
Mark Otto committed
64
  max-width: none;
Mark Otto's avatar
Mark Otto committed
65
66
67
}


68
69
70
71
72
73
74
75
76
77
78
79
80
//
// Docs examples
//

.bd-example {
  position: relative;
  padding: 1rem;
  margin: 1rem -1rem;
  border: solid #f7f7f9;
  border-width: .2rem 0 0;
  @include clearfix();

  @include media-breakpoint-up(sm) {
Mark Otto's avatar
Mark Otto committed
81
    padding: 1.5rem;
82
    margin-right: 0;
83
    margin-bottom: 0;
84
    margin-left: 0;
85
86
87
    border-width: .2rem;
  }

Mark Otto's avatar
Mark Otto committed
88
  + .highlight,
89
  + .clipboard + .highlight {
Mark Otto's avatar
Mark Otto committed
90
91
92
    margin-top: 0;
  }

93
94
95
96
97
98
99
100
101
  + p {
    margin-top: 2rem;
  }

  // Undo width of container
  .container {
    width: auto;
  }

102
103
104
105
106
107
  > .form-control {
    + .form-control {
      margin-top: .5rem;
    }
  }

108
  // Card examples should be horizontal
109
110
111
  > .card {
    max-width: 20rem;
  }
112
113
114

  > .nav + .nav,
  > .alert + .alert,
115
  > .navbar + .navbar,
116
117
  > .progress + .progress,
  > .progress + .btn {
118
119
120
121
122
123
124
125
126
127
128
129
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
    margin-top: 1rem;
  }

  > .dropdown-menu:first-child {
    position: static;
    display: block;
  }
}

.bd-example > .close {
  float: none;
}

// Typography
.bd-example-type .table .type-info {
  color: #999;
  vertical-align: middle;
}
.bd-example-type .table td {
  padding: 1rem 0;
  border-color: #eee;
}
.bd-example-type .table tr:first-child td {
  border-top: 0;
}
.bd-example-type h1,
.bd-example-type h2,
.bd-example-type h3,
.bd-example-type h4,
.bd-example-type h5,
.bd-example-type h6 {
  margin: 0;
}

// Contextual background colors
.bd-example-bg-classes p {
  padding: 1rem;
}

// Images
.bd-example > img {
  + img {
    margin-left: .5rem;
  }
}

// Buttons
.bd-example > .btn-group {
  margin-top: .25rem;
  margin-bottom: .25rem;
}
.bd-example > .btn-toolbar + .btn-toolbar {
  margin-top: .5rem;
}

// Forms
.bd-example-control-sizing select,
.bd-example-control-sizing input[type="text"] + input[type="text"] {
  margin-top: .5rem;
}
.bd-example-form .input-group {
  margin-bottom: .5rem;
}
.bd-example > textarea.form-control {
  resize: vertical;
}

// List groups
.bd-example > .list-group {
  max-width: 400px;
}

// Navbars
Mark Otto's avatar
Mark Otto committed
191
.bd-example {
Mark Otto's avatar
Mark Otto committed
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
  .navbar-fixed-top {
    position: static;
    margin: -1rem -1rem 1rem;
  }
  .navbar-fixed-bottom {
    position: static;
    margin: 1rem -1rem -1rem;
  }

  @include media-breakpoint-up(sm) {
    .navbar-fixed-top {
      margin: -1.5rem -1.5rem 1rem;
    }
    .navbar-fixed-bottom {
      margin: 1rem -1.5rem -1.5rem;
    }
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
  }
}

// Pagination
.bd-example .pagination {
  margin-top: .5rem;
  margin-bottom: .5rem;
}

// Example modals
.bd-example-modal {
  background-color: #f5f5f5;
}
.bd-example-modal .modal {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: 1;
  display: block;
}
.bd-example-modal .modal-dialog {
  left: auto;
  margin-right: auto;
  margin-left: auto;
}

// Example dropdowns
.bd-example > .dropdown > .dropdown-toggle {
  float: left;
}
.bd-example > .dropdown > .dropdown-menu {
  position: static;
  display: block;
  margin-bottom: .25rem;
  clear: left;
}

// Example tabbable tabs
.bd-example-tabs .nav-tabs {
  margin-bottom: 1rem;
}

// Tooltips
.bd-example-tooltips {
  text-align: center;
}
.bd-example-tooltips > .btn {
  margin-top: .25rem;
  margin-bottom: .25rem;
}

// Popovers
262
.bd-example-popover-static {
263
264
265
  padding-bottom: 1.5rem;
  background-color: #f9f9f9;
}
266
.bd-example-popover-static .popover {
267
268
269
270
271
272
273
274
  position: relative;
  display: block;
  float: left;
  width: 260px;
  margin: 1.25rem;
}

// Tooltips
275
276
277
278
.tooltip-demo a {
  white-space: nowrap;
}

279
.bd-example-tooltip-static .tooltip {
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
  position: relative;
  display: inline-block;
  margin: 10px 20px;
  opacity: 1;
}

// Scrollspy demo on fixed height div
.scrollspy-example {
  position: relative;
  height: 200px;
  margin-top: .5rem;
  overflow: auto;
}

// Helpers
.bd-example > {
  .center-block:not(img) {
    max-width: 200px;
    padding: .5rem;
    background-color: #eee;
  }

  .bg-primary,
  .bg-success,
  .bg-info,
  .bg-warning,
petetnt's avatar
petetnt committed
306
307
  .bg-danger,
  .bg-inverse {
308
309
310
311
312
    &:not(.navbar) {
      padding: .5rem;
      margin-top: .5rem;
      margin-bottom: .5rem;
    }
313
314
315
316
317
318
319
320
321
322
  }
}


//
// Code snippets
//

.highlight {
  padding: 1rem;
323
  margin: 1rem (-$grid-gutter-width / 2);
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
  background-color: #f7f7f9;

  @include media-breakpoint-up(sm) {
    padding: 1.5rem;
    margin-right: 0;
    margin-left: 0;
  }
}
.highlight pre {
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
  background-color: transparent;
  border: 0;
}
.highlight pre code {
  font-size: inherit;
  color: $gray-dark; // Effectively the base text color
}