patterns.less 10.4 KB
Newer Older
1
/* Patterns.less
2
 * Repeatable UI elements outside the base styles provided from the scaffolding
3
 * ---------------------------------------------------------------------------- */
Jacob Thornton's avatar
Jacob Thornton committed
4

5
6
// Topbar
// ------
Jacob Thornton's avatar
Jacob Thornton committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

// Topbar for Branding and Nav
div.topbar {
  #gradient > .vertical(#333, #222);
  height: 40px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  overflow: visible;
  @shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);
  .box-shadow(@shadow);
  // Links get text shadow
  a {
22
    color: @grayLight;
Jacob Thornton's avatar
Jacob Thornton committed
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    text-shadow: 0 -1px 0 rgba(0,0,0,.25);
    .transition(all linear .1s);
  }
  // Hover and active states for links
  ul li a:hover,
  ul li.active a,
  a.logo:hover {
    background-color: #333;
    background-color: rgba(255,255,255,.15);
    color: @white;
    text-decoration: none;
  }
  // Logo
  a.logo {
    float: left;
    display: block;
    padding: 8px 20px 12px;
    margin-left: -20px;
    color: @white;
    font-size: 20px;
    font-weight: 200;
    line-height: 1;
    img {
      float: left;
      margin-right: 6px;
    }
  }
  // Search Form
  form {
    float: left;
Mark Otto's avatar
Mark Otto committed
53
    margin: 5px 0 0 0;
Jacob Thornton's avatar
Jacob Thornton committed
54
55
56
    opacity: 1;
    position: relative;
    input {
57
      background-color: @grayLight;
Jacob Thornton's avatar
Jacob Thornton committed
58
      background-color: rgba(255,255,255,.3);
59
      #font > .sans-serif(13px, normal, 1);
Jacob Thornton's avatar
Jacob Thornton committed
60
61
62
63
64
65
66
67
68
69
70
      width: 220px;
      padding: 4px 9px;
      color: #fff;
      color: rgba(255,255,255,.75);
      border: 1px solid #111;
      .border-radius(4px);
      @shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.25);
      .box-shadow(@shadow);
      .transition(none);
      // Placeholder text gets special styles; can't be bundled together though for some reason
      &:-moz-placeholder {
71
        color: @grayLighter;
Jacob Thornton's avatar
Jacob Thornton committed
72
73
      }
      &::-webkit-input-placeholder {
74
        color: @grayLighter;
Jacob Thornton's avatar
Jacob Thornton committed
75
76
77
78
79
80
81
82
83
84
      }
      &:hover {
        background-color: #444;
        background-color: rgba(255,255,255,.5);
        color: #fff;
      }
      &:focus,
      &.focused {
        outline: none;
        background-color: #fff;
85
        color: @grayDark;
Jacob Thornton's avatar
Jacob Thornton committed
86
87
88
89
90
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
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
        text-shadow: 0 1px 0 #fff;
        border: 0;
        padding: 5px 10px;
        .box-shadow(0 0 3px rgba(0,0,0,.15));
      }
    }
  }
  // Navigation
  ul {
    display: block;
    float: left;
    margin: 0 10px 0 0;
    &.secondary-nav {
      float: right;
      margin-left: 10px;
      margin-right: 0;
    }
    li {
      display: block;
      float: left;
      font-size: 13px;
      a {
        display: block;
        float: none;
        padding: 10px 10px 11px;
        line-height: 19px;
        text-decoration: none;
        &:hover {
          color: #fff;
          text-decoration: none;
        }
      }
      &.active a {
        background-color: #222;
        background-color: rgba(0,0,0,.5);
      }
    }
    // Dropdowns
    &.primary-nav li ul {
      left: 0;
    }
    &.secondary-nav li ul {
      right: 0;
    }
    li.menu {
      position: relative;
      a.menu {
        &:after {
          width: 7px;
          height: 7px;
          display: inline-block;
          background: transparent url(assets/img/dropdown-arrow.gif) no-repeat top center;
          content: "↓";
          text-indent: -99999px;
          vertical-align: top;
          margin-top: 8px;
          margin-left: 4px;
          opacity: .5;
        }
      }
      &.open {
        a.menu,
        a:hover {
          background-color: lighten(#00a0d1,5);
          background-color: rgba(255,255,255,.1);
          color: #fff;
        }
        ul {
          display: block;
          li {
            a {
              background-color: transparent;
              font-weight: normal;
              &:hover {
                background-color: rgba(255,255,255,.1);
                color: #fff;
              }
            }
            &.active a {
              background-color: rgba(255,255,255,.1);
              font-weight: bold;
            }
          }
        }
      }
    }
    li ul {
      background-color: #333;
      float: left;
      display: none;
      position: absolute;
      top: 40px;
      min-width: 160px;
      max-width: 220px;
      _width: 160px;
      margin-left: 0;
      margin-right: 0;
      padding: 0;
      text-align: left;
      border: 0;
      zoom: 1;
      .border-radius(0 0 5px 5px);
      .box-shadow(0 1px 2px rgba(0,0,0,0.6));
      li {
        float: none;
        clear: both;
        display: block;
        background: none;
        font-size: 12px;
        a {
          display: block;
          padding: 6px 15px;
          clear: both;
          font-weight: normal;
          line-height: 19px;
          color: #bbb;
          &:hover {
            background-color: #333;
            background-color: rgba(255,255,255,.25);
            color: #fff;
          }
        }
        // Dividers (basically an hr)
        &.divider {
          height: 1px;
          overflow: hidden;
          background: rgba(0,0,0,.2);
          border-bottom: 1px solid rgba(255,255,255,.1);
          margin: 5px 0;
        }
        // Section separaters
        span {
          clear: both;
          display: block;
          background: rgba(0,0,0,.2);
          padding: 6px 15px;
          cursor: default;
223
          color: @gray;
Jacob Thornton's avatar
Jacob Thornton committed
224
225
226
227
228
229
230
          border-top: 1px solid rgba(0,0,0,.2);
        }
      }
    }
  }
}

231
232
// Page Headers
// ------------
Jacob Thornton's avatar
Jacob Thornton committed
233
234
235
236
237
238

div.page-header {
  margin-bottom: @baseline - 1;
  border-bottom: 1px solid #ddd;
  .box-shadow(0 1px 0 rgba(255,255,255,.5));
  h1 {
239
    margin-bottom: (@baseline / 2) - 1px;
Jacob Thornton's avatar
Jacob Thornton committed
240
241
242
243
  }
}


244
245
// Error Styles
// ------------
Jacob Thornton's avatar
Jacob Thornton committed
246
247
248
249

// One-liner alert bars
div.alert-message {
  #gradient > .vertical(transparent, rgba(0,0,0,0.15));
250
  background-color: @grayLighter;
Jacob Thornton's avatar
Jacob Thornton committed
251
  margin-bottom: @baseline;
252
  padding: 8px 15px;
Jacob Thornton's avatar
Jacob Thornton committed
253
254
  color: #fff;
  text-shadow: 0 -1px 0 rgba(0,0,0,.25);
255
256
  border-bottom: 1px solid rgba(0,0,0,.25);
  .border-radius(4px);
Jacob Thornton's avatar
Jacob Thornton committed
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
  p {
    color: #fff;
    margin-bottom: 0;
    + p {
      margin-top: 5px;
    }
  }
  &.error {
    background-color: lighten(@red, 25%);
  }
  &.warning {
    background-color: lighten(@yellow, 15%);
  }
  &.success {
    background-color: lighten(@green, 15%);
  }
  &.info {
    background-color: lighten(@blue, 15%);
  }
  a.close {
    float: right;
    margin-top: -2px;
    opacity: .5;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 1px 0 rgba(0,0,0,.5);
    .border-radius(3px);
    &:hover {
      opacity: 1;
      text-decoration: none;
    }
  }
}

// Block-level Alerts
div.block-message {
  margin-bottom: @baseline;
295
296
  padding: 14px;
  color: @grayDark;
Jacob Thornton's avatar
Jacob Thornton committed
297
298
299
300
  color: rgba(0,0,0,.8);
  text-shadow: 0 1px 0 rgba(255,255,255,.25);
  .border-radius(6px);
  p {
301
    color: @grayDark;
Jacob Thornton's avatar
Jacob Thornton committed
302
303
304
305
306
307
308
309
310
311
312
313
    color: rgba(0,0,0,.8);
    margin-right: 30px;
    margin-bottom: 0;
  }
  ul {
    margin-bottom: 0;
  }
  strong {
    display: block;
  }
  a.close {
    display: block;
314
    color: @grayDark;
Jacob Thornton's avatar
Jacob Thornton committed
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
    color: rgba(0,0,0,.5);
    text-shadow: 0 1px 1px rgba(255,255,255,.75);
  }
  &.error {
    background: lighten(@red, 55%);
    border: 1px solid lighten(@red, 50%);
  }
  &.warning {
    background: lighten(@yellow, 35%);
    border: 1px solid lighten(@yellow, 25%)
  }
  &.success {
    background: lighten(@green, 45%);
    border: 1px solid lighten(@green, 35%)
  }
  &.info {
    background: lighten(@blue, 45%);
    border: 1px solid lighten(@blue, 40%);
  }
}


337
338
// Navigation
// ----------
Jacob Thornton's avatar
Jacob Thornton committed
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356

// Common tab and pill styles
ul.tabs,
ul.pills {
  margin: 0 0 20px;
  padding: 0;
  .clearfix();
  li {
    display: inline;
    a {
      float: left;
      width: auto;
    }
  }
}
// Basic Tabs
ul.tabs {
  width: 100%;
357
  border-bottom: 1px solid @grayLight;
Jacob Thornton's avatar
Jacob Thornton committed
358
359
360
361
362
363
364
365
  li {
    a {
      margin-bottom: -1px;
      margin-right: 2px;
      padding: 0 15px;
      line-height: (@baseline * 2) - 1;
      .border-radius(3px 3px 0 0);
      &:hover {
366
367
        background-color: @grayLighter;
        border-bottom: 1px solid @grayLight;
Jacob Thornton's avatar
Jacob Thornton committed
368
369
370
      }
    }
    &.active a {
371
      background-color: #fff;
Jacob Thornton's avatar
Jacob Thornton committed
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
      padding: 0 14px;
      border: 1px solid #ccc;
      border-bottom: 0;
      color: @gray;
    }
  }
}
// Basic pill nav
ul.pills {
  li {
    a {
      margin: 5px 3px 5px 0;
      padding: 0 15px;
      text-shadow: 0 1px 1px #fff;
      line-height: 30px;
      .border-radius(15px);
      &:hover {
389
        background: @linkColorHover;
Jacob Thornton's avatar
Jacob Thornton committed
390
391
392
393
394
395
        color: #fff;
        text-decoration: none;
        text-shadow: 0 1px 1px rgba(0,0,0,.25);
      }
    }
    &.active a {
396
      background: @linkColor;
Jacob Thornton's avatar
Jacob Thornton committed
397
398
399
400
401
402
403
      color: #fff;
      text-shadow: 0 1px 1px rgba(0,0,0,.25);
    }
  }
}


404
405
// Pagination
// --------------------------------------------------
Jacob Thornton's avatar
Jacob Thornton committed
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431

div.pagination {
  height: @baseline * 2;
  margin: @baseline 0;
  ul {
    float: left;
    margin: 0;
    border: 1px solid rgba(0,0,0,.15);
    .border-radius(3px);
    .box-shadow(0 1px 2px rgba(0,0,0,.075);
    li {
      display: inline;
      a {
        float: left;
        padding: 0 14px;
        line-height: (@baseline * 2) - 2;
        border-right: 1px solid rgba(0,0,0,.15);
        text-decoration: none;
      }
      a:hover,
      &.active a {
        background-color: lighten(@blue, 45%);
      }
      &.disabled a,
      &.disabled a:hover {
        background-color: none;
432
        color: @grayLight;
Jacob Thornton's avatar
Jacob Thornton committed
433
434
435
436
437
438
439
440
441
442
      }
      &.next a,
      &:last-child a {
        border: 0;
      }
    }
  }
}


443
444
// Wells
// -----
Jacob Thornton's avatar
Jacob Thornton committed
445
446
447
448
449
450
451
452

div.well {
  background: #f5f5f5;
  margin-bottom: 20px;
  padding: 19px;
  min-height: 20px;
  border: 1px solid #ddd;
  .border-radius(4px);
453
  .box-shadow(inset 0 1px 1px rgba(0,0,0,.05);
Jacob Thornton's avatar
Jacob Thornton committed
454
}
455
456


457
458
// Modals
// ------
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473

div.modal-backdrop {
  background-color: rgba(0,0,0,.5);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
}
div.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2000;
474
475
  width: 560px;
  margin: -280px 0 0 -250px;
476
  background-color: @white;
Mark Otto's avatar
Mark Otto committed
477
  border: 1px solid rgba(0,0,0,.3);
478
  .border-radius(6px);
479
480
  .box-shadow(0 3px 7px rgba(0,0,0,0.3));
  .background-clip(padding);
Jacob Thornton's avatar
Jacob Thornton committed
481
  .modal-header {
482
    border-bottom: 1px solid #eee;
Jacob Thornton's avatar
Jacob Thornton committed
483
484
485
486
487
488
489
490
491
492
    padding: 5px 20px;
    a.close {
      position: absolute;
      right: 10px;
      top: 10px;
      color: #999;
      line-height:10px;
      font-size: 18px;
    }
  }
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
  .modal-body {
    padding: 20px;
  }
  .modal-footer {
    background-color: #eee;
    padding: 14px 20px 15px;
    border-top: 1px solid #ddd;
    .border-radius(0 0 6px 6px);
    .box-shadow(inset 0 1px 0 #fff);
    .clearfix();
    .btn {
      float: right;
      margin-left: 10px;
    }
  }
508
}