_component-examples.scss 5.46 KB
Newer Older
Mark Otto's avatar
Mark Otto committed
1
2
// scss-lint:disable QualifyingElement

3
4
5
6
//
// Grid examples
//

Mark Otto's avatar
Mark Otto committed
7
.bd-example-row {
8
9
10
  .row + .row {
    margin-top: 1rem;
  }
Mark Otto's avatar
Mark Otto committed
11

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

22
23
24
  .flex-items-xs-top,
  .flex-items-xs-middle,
  .flex-items-xs-bottom {
25
26
27
28
29
30
31
32
    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);
33
34
35
}


Mark Otto's avatar
Mark Otto committed
36
37
38
39
40
//
// Container illustrations
//

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

.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
70
  max-width: none;
Mark Otto's avatar
Mark Otto committed
71
72
73
}


74
75
76
77
78
79
80
81
82
83
84
85
86
//
// 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
87
    padding: 1.5rem;
88
    margin-right: 0;
89
    margin-bottom: 0;
90
    margin-left: 0;
91
92
93
    border-width: .2rem;
  }

Mark Otto's avatar
Mark Otto committed
94
  + .highlight,
95
  + .clipboard + .highlight {
Mark Otto's avatar
Mark Otto committed
96
97
98
    margin-top: 0;
  }

99
100
101
102
103
104
105
106
107
  + p {
    margin-top: 2rem;
  }

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

108
109
110
111
112
113
  > .form-control {
    + .form-control {
      margin-top: .5rem;
    }
  }

114
  // Card examples should be horizontal
115
116
117
  > .card {
    max-width: 20rem;
  }
118
119
120

  > .nav + .nav,
  > .alert + .alert,
121
  > .navbar + .navbar,
122
123
  > .progress + .progress,
  > .progress + .btn {
124
125
126
127
128
129
130
    margin-top: 1rem;
  }

  > .dropdown-menu:first-child {
    position: static;
    display: block;
  }
Mark Otto's avatar
Mark Otto committed
131
132
133
134

  > .form-group:last-child {
    margin-bottom: 0;
  }
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
191
192
193
194
195
196
197
198
199
200
}

.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
201
.bd-example {
Mark Otto's avatar
Mark Otto committed
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
  .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;
    }
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
262
263
264
265
266
267
268
269
270
271
  }
}

// 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
272
.bd-example-popover-static {
273
274
275
  padding-bottom: 1.5rem;
  background-color: #f9f9f9;
}
276
.bd-example-popover-static .popover {
277
278
279
280
281
282
283
284
  position: relative;
  display: block;
  float: left;
  width: 260px;
  margin: 1.25rem;
}

// Tooltips
285
286
287
288
.tooltip-demo a {
  white-space: nowrap;
}

289
.bd-example-tooltip-static .tooltip {
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
  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 > {
  .bg-primary,
  .bg-success,
  .bg-info,
  .bg-warning,
petetnt's avatar
petetnt committed
310
311
  .bg-danger,
  .bg-inverse {
312
313
314
315
316
    &:not(.navbar) {
      padding: .5rem;
      margin-top: .5rem;
      margin-bottom: .5rem;
    }
317
318
319
320
321
322
323
324
325
326
  }
}


//
// Code snippets
//

.highlight {
  padding: 1rem;
Kovah's avatar
Kovah committed
327
  margin: 1rem (-$grid-gutter-width-base / 2);
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
  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
}