aboutsummaryrefslogtreecommitdiff
path: root/lib/patterns.less
blob: a2d512339d884e5a4b8841b561c1b19ea4687fcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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
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
272
273
274
275
276
277
278
279
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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
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
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
// Patterns.less
// Repeatable UI elements outside the base styles provided from the scaffolding
// ----------------------------------------------------------------------------


// NAVBAR (FIXED AND STATIC)
// -------------------------

// Navbar variables
@navBarHeight: 40px;
@navBarBgStart: #333;
@navBarBgEnd: #222;

// Common styles
.navbar {
  height: @navBarHeight;
  overflow: visible;
}
// gradient is applied to it's own element because overflow visible is not honored by ie when filter is present
.navbar-inner {
  background-color: @navBarBgEnd;
  #gradient > .vertical(@navBarBgStart, @navBarBgEnd);
  @shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);
  .box-shadow(@shadow);
}
// Text and links
.navbar {
  // Links get text-shadow
  a {
    color: @grayLight;
    text-shadow: 0 -1px 0 rgba(0,0,0,.25);
  }
  // Hover and active states
  .brand a:hover,
  ul .active > a {
    color: @white;
    text-decoration: none;
    background-color: @navBarBgStart;
    background-color: rgba(255,255,255,.05);
  }
  // Website or project name
  .brand {
    float: left;
    display: block;
    padding: 8px 20px 12px;
    margin-left: -20px; // negative indent to left-align the text down the page
    font-size: 20px;
    font-weight: 200;
    line-height: 1;
    color: @white;
  }
  // Plain text in topbar
  p {
    margin: 0;
    line-height: 40px;
    a:hover {
      color: @white;
      background-color: transparent;
    }
  }
}

// Navbar search
.navbar-search {
  position: relative;
  float: left;
  margin-top: 6px;
  margin-bottom: 0;
  .search-query {
    padding: 4px 9px;
    #font > .sans-serif(13px, normal, 1);
    color: @white;
    color: rgba(255,255,255,.75);
    background-color: #444;
    background-color: rgba(255,255,255,.3);
    border: 1px solid #111;
    @shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.15);
    .box-shadow(@shadow);
    .transition(none);

    // Placeholder text gets special styles; can't be bundled together though for some reason
    &:-moz-placeholder {
      color: @grayLighter;
    }
    &::-webkit-input-placeholder {
      color: @grayLighter;
    }
    // Hover states
    &:hover {
      color: @white;
      background-color: @grayLight;
      background-color: rgba(255,255,255,.5);
    }
    // Focus states (we use .focused since IE8 and down doesn't support :focus)
    &:focus,
    &.focused {
      padding: 5px 10px;
      color: @grayDark;
      text-shadow: 0 1px 0 @white;
      background-color: @white;
      border: 0;
      .box-shadow(0 0 3px rgba(0,0,0,.15));
      outline: 0;
    }
  }
}


// Static navbar
.navbar-static {
  margin-bottom: @baseLineHeight;
}
.navbar-static .navbar-inner {
  padding-left:  20px;
  padding-right: 20px;
  .border-radius(4px);
}

// Fixed navbar
.navbar-fixed {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10000;
}



// NAVIGATION
// ----------

// Nav for navbar and topbar
// ul.nav for all topbar based navigation to avoid inheritance issues and over-specificity
.nav {
  position: relative;
  left: 0;
  display: block;
  float: left;
  margin: 0 10px 0 0;
  > li {
    display: block;
    float: left;
  }
  a {
    display: block;
    float: none;
    padding: 10px 10px 11px;
    line-height: 19px;
    text-decoration: none;
    &:hover {
      color: @white;
      text-decoration: none;
    }
  }
  .active > a {
    background-color: #222;
    background-color: rgba(0,0,0,.5);
  }
  // Dividers (basically a vertical hr)
  .divider {
    height: 40px;
    width: 1px;
    margin: 0 5px;
    overflow: hidden;
    background-color: #222;
    border-right: 1px solid #444;
  }

  // Secondary (floated right) nav in topbar
  &.secondary-nav {
    float: right;
    margin-left: 10px;
    margin-right: 0;
    .dropdown-menu {
      right: 0;
      border: 0;
    }
  }
  // Dropdowns within the .nav
  .dropdown-toggle:hover,
  .dropdown.open .dropdown-toggle {
    background: #444;
    background: rgba(255,255,255,.05);
  }
  .dropdown-menu {
    background-color: #333;
    .dropdown-toggle {
      color: @white;
      &.open {
        background: #444;
        background: rgba(255,255,255,.05);
      }
    }
    li a {
      color: #999;
      text-shadow: 0 1px 0 rgba(0,0,0,.5);
      &:hover {
        #gradient > .vertical(#292929,#191919);
        color: @white;
      }
    }
    .active a {
      color: @white;
    }
    .divider {
      background-color: #222;
      border-color: #444;
    }
  }
}

.topbar ul .dropdown-menu li a {
  padding: 4px 15px;
}

// Dropdown Menus
// Use the .menu class on any <li> element within the topbar or ul.tabs and you'll get some superfancy dropdowns
.dropdown {
  position: relative;
}
// The link that is clicked to toggle the dropdown
.dropdown-toggle:after {
  display: inline-block;
  width: 0;
  height: 0;
  margin-top: 8px;
  margin-left: 6px;
  text-indent: -99999px;
  vertical-align: top;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid @white;
  .opacity(30);
  content: "&darr;";
}
.dropdown:hover .dropdown-toggle:after {
  .opacity(100);
}
// The dropdown menu (ul)
.dropdown-menu {
  position: absolute;
  top: 40px;
  z-index: 900;
  float: left;
  display: none; // None by default, but block on "open" of the menu
  min-width: 160px;
  max-width: 220px;
  _width: 160px;
  padding: 6px 0;
  margin-left: 0; // override default ul styles
  margin-right: 0;
  background-color: @white;
  border-color: #999;
  border-color: rgba(0,0,0,.2);
  border-style: solid;
  border-width: 0 1px 1px;
  .border-radius(0 0 6px 6px);
  .box-shadow(0 2px 4px rgba(0,0,0,.2));
  .background-clip(padding-box);
  zoom: 1; // do we need this?

  // Unfloat any li's to make them stack
  li {
    float: none;
    display: block;
    background-color: none;
  }
  // Dividers (basically an hr) within the dropdown
  .divider {
    height: 1px;
    margin: 5px 0;
    overflow: hidden;
    background-color: #eee;
    border-bottom: 1px solid @white;
  }
}

.topbar .dropdown-menu, .dropdown-menu {
  // Links within the dropdown menu
  a {
    display: block;
    padding: 4px 15px;
    clear: both;
    font-weight: normal;
    line-height: 18px;
    color: @gray;
    text-shadow: 0 1px 0 @white;
    // Hover state
    &:hover {
      color: @grayDark;
      text-decoration: none;
      #gradient > .vertical(#eeeeee, #dddddd);
      @shadow: inset 0 1px 0 rgba(0,0,0,.025), inset 0 -1px rgba(0,0,0,.025);
      .box-shadow(@shadow);
    }
  }
}

// Open state for the dropdown
.dropdown.open {
  .dropdown-toggle {
    color: @white;
    background: #ccc;
    background: rgba(0,0,0,.3);
  }
  .dropdown-menu {
    display: block;
  }
}






// PAGE HEADERS
// ------------

.hero-unit {
  padding: 60px;
  margin-bottom: 30px;
  background-color: #f5f5f5;
  .border-radius(6px);
  h1 {
    margin-bottom: 0;
    font-size: 60px;
    line-height: 1;
    letter-spacing: -1px;
  }
  p {
    font-size: 18px;
    font-weight: 200;
    line-height: @baseLineHeight * 1.5;
  }
}
footer {
  padding-top: @baseLineHeight - 1;
  margin-top: @baseLineHeight - 1;
  border-top: 1px solid #eee;
}


// PAGE HEADERS
// ------------

.page-header {
  margin-bottom: @baseLineHeight * 1.5;
  border-bottom: 1px solid #eee;
  .box-shadow(0 1px 0 rgba(255,255,255,.5));
  h1 {
    margin-bottom: @baseLineHeight * .75;
  }
}


// BUTTON STYLES
// -------------

// Shared colors for buttons and alerts
.btn,
.alert-message {
  // Set text color
  &.danger,
  &.danger:hover,
  &.error,
  &.error:hover,
  &.success,
  &.success:hover,
  &.info,
  &.info:hover {
    color: @white
  }
  // Danger and error appear as red
  &.danger,
  &.error {
    .gradientBar(#ee5f5b, #c43c35);
  }
  // Success appears as green
  &.success {
    .gradientBar(#62c462, #57a957);
  }
  // Info appears as a neutral blue
  &.info {
    .gradientBar(#5bc0de, #339bb9);
  }
}

// Base .btn styles
.btn {
  // Button Base
  display: inline-block;
  padding: 5px 14px 6px;
  font-size: @baseFontSize;
  line-height: normal;
  color: #333;
  text-shadow: 0 1px 1px rgba(255,255,255,.75);
  #gradient > .vertical-three-colors(#ffffff, #ffffff, 25%, darken(#ffffff, 10%)); // Don't use .gradientbar() here since it does a three-color gradient
  border: 1px solid #ccc;
  border-bottom-color: #bbb;
  .border-radius(4px);
  @shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
  .box-shadow(@shadow);
  cursor: pointer;

  &:hover {
    color: #333;
    text-decoration: none;
    background-position: 0 -15px;
  }

  // Focus state for keyboard and accessibility
  &:focus {
    outline: 1px dotted #666;
  }

  // Primary Button Type
  &.primary {
    color: @white;
    .gradientBar(@blue, @blueDark)
  }

   // Transitions
  .transition(.1s linear all);

  // Active and Disabled states
  &.active,
  &:active {
    @shadow: inset 0 2px 4px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.05);
    .box-shadow(@shadow);
  }
  &.disabled {
    cursor: default;
    background-image: none;
    .reset-filter();
    .opacity(65);
    .box-shadow(none);
  }
  &[disabled] {
    // disabled pseudo can't be included with .disabled
    // def because IE8 and below will drop it ;_;
    cursor: default;
    background-image: none;
    .reset-filter();
    .opacity(65);
    .box-shadow(none);
  }

  // Button Sizes
  &.large {
    padding: 9px 14px 9px;
    font-size: @baseFontSize + 2px;
    line-height: normal;
    .border-radius(6px);
  }
  &.small {
    padding: 7px 9px 7px;
    font-size: @baseFontSize - 2px;
  }
}
// Super jank hack for removing border-radius from IE9 so we can keep filter gradients on alerts and buttons
:root .alert-message,
:root .btn {
  border-radius: 0 \0;
}

// Help Firefox not be a jerk about adding extra padding to buttons
button.btn,
input[type=submit].btn {
  &::-moz-focus-inner {
  	padding: 0;
  	border: 0;
  }
}

// Button groups
// -------------

// Group multiple button groups together for a toolbar
.btn-toolbar {
  .clearfix();
  .btn-group {
    float: left;
    margin-right: 10px;
  }
}

// Clear the float
.btn-group {
  .clearfix();
}
// Float them, remove border radius, then re-add to first and last elements
.btn-group .btn {
  position: relative;
  float: left;
  margin-left: -1px;
  .border-radius(0);
  &:first-child {
    margin-left: 0;
       -webkit-border-top-left-radius: 4px;
           -moz-border-radius-topleft: 4px;
               border-top-left-radius: 4px;
    -webkit-border-bottom-left-radius: 4px;
        -moz-border-radius-bottomleft: 4px;
            border-bottom-left-radius: 4px;
  }
  &:last-child {
       -webkit-border-top-right-radius: 4px;
           -moz-border-radius-topright: 4px;
               border-top-right-radius: 4px;
    -webkit-border-bottom-right-radius: 4px;
        -moz-border-radius-bottomright: 4px;
            border-bottom-right-radius: 4px;
  }
}
// On hover/focus/active, bring the proper btn to front
.btn-group .btn:hover,
.btn-group .btn:focus,
.btn-group .btn:active {
  z-index: 2;
}



// CLOSE ICONS
// -----------
.close {
  float: right;
  font-size: 20px;
  font-weight: bold;
  line-height: @baseLineHeight * .75;
  color: @black;
  text-shadow: 0 1px 0 rgba(255,255,255,1);
  .opacity(20);
  &:hover {
    color: @black;
    text-decoration: none;
    .opacity(40);
  }
}


// ERROR STYLES
// ------------

// Base alert styles
.alert-message {
  position: relative;
  padding: 7px 15px;
  margin-bottom: @baseLineHeight;
  color: @grayDark;
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
  .gradientBar(#fceec1, #eedc94); // warning by default
  border-width: 1px;
  border-style: solid;
  .border-radius(4px);
  .box-shadow(inset 0 1px 0 rgba(255,255,255,.25));

  // Adjust close icon
  .close {
    *margin-top: 3px; /* IE7 spacing */
  }

  // Remove extra margin from content
  h5 {
    line-height: @baseLineHeight;
  }
  p {
    margin-bottom: 0;
  }
  div {
    margin-top: 5px;
    margin-bottom: 2px;
    line-height: 28px;
  }
  .btn {
    // Provide actions with buttons
    .box-shadow(0 1px 0 rgba(255,255,255,.25));
  }

  &.block-message {
    padding: 14px;
    background-image: none;
    background-color: lighten(#fceec1, 5%);
    .reset-filter(); // undo gradient for IE9
    border-color: #fceec1;
    .box-shadow(none);
    ul, p {
      margin-right: 30px;
    }
    ul {
      margin-bottom: 0;
    }
    li {
      color: @grayDark;
    }
    .alert-actions {
      margin-top: 5px;
    }
    &.error,
    &.success,
    &.info {
      color: @grayDark;
      text-shadow: 0 1px 0 rgba(255,255,255,.5);
    }
    &.error {
      background-color: lighten(#f56a66, 25%);
      border-color: lighten(#f56a66, 20%);
    }
    &.success {
      background-color: lighten(#62c462, 30%);
      border-color: lighten(#62c462, 25%);
    }
    &.info {
      background-color: lighten(#6bd0ee, 25%);
      border-color: lighten(#6bd0ee, 20%);
    }
  }
}




// WELLS
// -----

.well {
  min-height: 20px;
  padding: 19px;
  margin-bottom: 20px;
  background-color: #f5f5f5;
  border: 1px solid #eee;
  border: 1px solid rgba(0,0,0,.05);
  .border-radius(4px);
  .box-shadow(inset 0 1px 1px rgba(0,0,0,.05));
  blockquote {
    border-color: #ddd;
    border-color: rgba(0,0,0,.15);
  }
}


// PATTERN ANIMATIONS
// ------------------

.fade {
  .transition(opacity .15s linear);
  opacity: 0;
  &.in {
    opacity: 1;
  }
}

.collapse {
  .transition(height .35s ease);
  position:relative;
  overflow:hidden;
  height: 0;
  &.in { height: auto; }
}


// LABELS
// ------

.label {
  padding: 1px 3px 2px;
  font-size: @baseFontSize * .75;
  font-weight: bold;
  color: @white;
  text-transform: uppercase;
  background-color: @grayLight;
  .border-radius(3px);
  &.important { background-color: #c43c35; }
  &.warning   { background-color: @orange; }
  &.success   { background-color: @green; }
  &.notice    { background-color: lighten(@blue, 25%); }
}