static/less/navbar.less
author stetrabby <info@trabucchi.de>
Fri, 20 Dec 2013 22:30:44 +0100
changeset 53 3416f82943ea
permissions -rwxr-xr-x
less initial added
info@53
     1
//
info@53
     2
// Navbars
info@53
     3
// --------------------------------------------------
info@53
     4
info@53
     5
info@53
     6
// Wrapper and base class
info@53
     7
//
info@53
     8
// Provide a static navbar from which we expand to create full-width, fixed, and
info@53
     9
// other navbar variations.
info@53
    10
info@53
    11
.navbar {
info@53
    12
  position: relative;
info@53
    13
  min-height: @navbar-height; // Ensure a navbar always shows (e.g., without a .navbar-brand in collapsed mode)
info@53
    14
  margin-bottom: @navbar-margin-bottom;
info@53
    15
  border: 1px solid transparent;
info@53
    16
info@53
    17
  // Prevent floats from breaking the navbar
info@53
    18
  .clearfix();
info@53
    19
info@53
    20
  @media (min-width: @grid-float-breakpoint) {
info@53
    21
    border-radius: @navbar-border-radius;
info@53
    22
  }
info@53
    23
}
info@53
    24
info@53
    25
info@53
    26
// Navbar heading
info@53
    27
//
info@53
    28
// Groups `.navbar-brand` and `.navbar-toggle` into a single component for easy
info@53
    29
// styling of responsive aspects.
info@53
    30
info@53
    31
.navbar-header {
info@53
    32
  .clearfix();
info@53
    33
info@53
    34
  @media (min-width: @grid-float-breakpoint) {
info@53
    35
    float: left;
info@53
    36
  }
info@53
    37
}
info@53
    38
info@53
    39
info@53
    40
// Navbar collapse (body)
info@53
    41
//
info@53
    42
// Group your navbar content into this for easy collapsing and expanding across
info@53
    43
// various device sizes. By default, this content is collapsed when <768px, but
info@53
    44
// will expand past that for a horizontal display.
info@53
    45
//
info@53
    46
// To start (on mobile devices) the navbar links, forms, and buttons are stacked
info@53
    47
// vertically and include a `max-height` to overflow in case you have too much
info@53
    48
// content for the user's viewport.
info@53
    49
info@53
    50
.navbar-collapse {
info@53
    51
  max-height: 340px;
info@53
    52
  overflow-x: visible;
info@53
    53
  padding-right: @navbar-padding-horizontal;
info@53
    54
  padding-left:  @navbar-padding-horizontal;
info@53
    55
  border-top: 1px solid transparent;
info@53
    56
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
info@53
    57
  .clearfix();
info@53
    58
  -webkit-overflow-scrolling: touch;
info@53
    59
info@53
    60
  &.in {
info@53
    61
    overflow-y: auto;
info@53
    62
  }
info@53
    63
info@53
    64
  @media (min-width: @grid-float-breakpoint) {
info@53
    65
    width: auto;
info@53
    66
    border-top: 0;
info@53
    67
    box-shadow: none;
info@53
    68
info@53
    69
    &.collapse {
info@53
    70
      display: block !important;
info@53
    71
      height: auto !important;
info@53
    72
      padding-bottom: 0; // Override default setting
info@53
    73
      overflow: visible !important;
info@53
    74
    }
info@53
    75
info@53
    76
    &.in {
info@53
    77
      overflow-y: visible;
info@53
    78
    }
info@53
    79
info@53
    80
    // Undo the collapse side padding for navbars with containers to ensure
info@53
    81
    // alignment of right-aligned contents.
info@53
    82
    .navbar-fixed-top &,
info@53
    83
    .navbar-static-top &,
info@53
    84
    .navbar-fixed-bottom & {
info@53
    85
      padding-left: 0;
info@53
    86
      padding-right: 0;
info@53
    87
    }
info@53
    88
  }
info@53
    89
}
info@53
    90
info@53
    91
info@53
    92
// Both navbar header and collapse
info@53
    93
//
info@53
    94
// When a container is present, change the behavior of the header and collapse.
info@53
    95
info@53
    96
.container > .navbar-header,
info@53
    97
.container > .navbar-collapse {
info@53
    98
  margin-right: -@navbar-padding-horizontal;
info@53
    99
  margin-left:  -@navbar-padding-horizontal;
info@53
   100
info@53
   101
  @media (min-width: @grid-float-breakpoint) {
info@53
   102
    margin-right: 0;
info@53
   103
    margin-left:  0;
info@53
   104
  }
info@53
   105
}
info@53
   106
info@53
   107
info@53
   108
//
info@53
   109
// Navbar alignment options
info@53
   110
//
info@53
   111
// Display the navbar across the entirety of the page or fixed it to the top or
info@53
   112
// bottom of the page.
info@53
   113
info@53
   114
// Static top (unfixed, but 100% wide) navbar
info@53
   115
.navbar-static-top {
info@53
   116
  z-index: @zindex-navbar;
info@53
   117
  border-width: 0 0 1px;
info@53
   118
info@53
   119
  @media (min-width: @grid-float-breakpoint) {
info@53
   120
    border-radius: 0;
info@53
   121
  }
info@53
   122
}
info@53
   123
info@53
   124
// Fix the top/bottom navbars when screen real estate supports it
info@53
   125
.navbar-fixed-top,
info@53
   126
.navbar-fixed-bottom {
info@53
   127
  position: fixed;
info@53
   128
  right: 0;
info@53
   129
  left: 0;
info@53
   130
  z-index: @zindex-navbar-fixed;
info@53
   131
info@53
   132
  // Undo the rounded corners
info@53
   133
  @media (min-width: @grid-float-breakpoint) {
info@53
   134
    border-radius: 0;
info@53
   135
  }
info@53
   136
}
info@53
   137
.navbar-fixed-top {
info@53
   138
  top: 0;
info@53
   139
  border-width: 0 0 1px;
info@53
   140
}
info@53
   141
.navbar-fixed-bottom {
info@53
   142
  bottom: 0;
info@53
   143
  margin-bottom: 0; // override .navbar defaults
info@53
   144
  border-width: 1px 0 0;
info@53
   145
}
info@53
   146
info@53
   147
info@53
   148
// Brand/project name
info@53
   149
info@53
   150
.navbar-brand {
info@53
   151
  float: left;
info@53
   152
  padding: @navbar-padding-vertical @navbar-padding-horizontal;
info@53
   153
  font-size: @font-size-large;
info@53
   154
  line-height: @line-height-computed;
info@53
   155
info@53
   156
  &:hover,
info@53
   157
  &:focus {
info@53
   158
    text-decoration: none;
info@53
   159
  }
info@53
   160
info@53
   161
  @media (min-width: @grid-float-breakpoint) {
info@53
   162
    .navbar > .container & {
info@53
   163
      margin-left: -@navbar-padding-horizontal;
info@53
   164
    }
info@53
   165
  }
info@53
   166
}
info@53
   167
info@53
   168
info@53
   169
// Navbar toggle
info@53
   170
//
info@53
   171
// Custom button for toggling the `.navbar-collapse`, powered by the collapse
info@53
   172
// JavaScript plugin.
info@53
   173
info@53
   174
.navbar-toggle {
info@53
   175
  position: relative;
info@53
   176
  float: right;
info@53
   177
  margin-right: @navbar-padding-horizontal;
info@53
   178
  padding: 9px 10px;
info@53
   179
  .navbar-vertical-align(34px);
info@53
   180
  background-color: transparent;
info@53
   181
  background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
info@53
   182
  border: 1px solid transparent;
info@53
   183
  border-radius: @border-radius-base;
info@53
   184
info@53
   185
  // Bars
info@53
   186
  .icon-bar {
info@53
   187
    display: block;
info@53
   188
    width: 22px;
info@53
   189
    height: 2px;
info@53
   190
    border-radius: 1px;
info@53
   191
  }
info@53
   192
  .icon-bar + .icon-bar {
info@53
   193
    margin-top: 4px;
info@53
   194
  }
info@53
   195
info@53
   196
  @media (min-width: @grid-float-breakpoint) {
info@53
   197
    display: none;
info@53
   198
  }
info@53
   199
}
info@53
   200
info@53
   201
info@53
   202
// Navbar nav links
info@53
   203
//
info@53
   204
// Builds on top of the `.nav` components with it's own modifier class to make
info@53
   205
// the nav the full height of the horizontal nav (above 768px).
info@53
   206
info@53
   207
.navbar-nav {
info@53
   208
  margin: (@navbar-padding-vertical / 2) -@navbar-padding-horizontal;
info@53
   209
info@53
   210
  > li > a {
info@53
   211
    padding-top:    10px;
info@53
   212
    padding-bottom: 10px;
info@53
   213
    line-height: @line-height-computed;
info@53
   214
  }
info@53
   215
info@53
   216
  @media (max-width: @grid-float-breakpoint-max) {
info@53
   217
    // Dropdowns get custom display when collapsed
info@53
   218
    .open .dropdown-menu {
info@53
   219
      position: static;
info@53
   220
      float: none;
info@53
   221
      width: auto;
info@53
   222
      margin-top: 0;
info@53
   223
      background-color: transparent;
info@53
   224
      border: 0;
info@53
   225
      box-shadow: none;
info@53
   226
      > li > a,
info@53
   227
      .dropdown-header {
info@53
   228
        padding: 5px 15px 5px 25px;
info@53
   229
      }
info@53
   230
      > li > a {
info@53
   231
        line-height: @line-height-computed;
info@53
   232
        &:hover,
info@53
   233
        &:focus {
info@53
   234
          background-image: none;
info@53
   235
        }
info@53
   236
      }
info@53
   237
    }
info@53
   238
  }
info@53
   239
info@53
   240
  // Uncollapse the nav
info@53
   241
  @media (min-width: @grid-float-breakpoint) {
info@53
   242
    float: left;
info@53
   243
    margin: 0;
info@53
   244
info@53
   245
    > li {
info@53
   246
      float: left;
info@53
   247
      > a {
info@53
   248
        padding-top:    @navbar-padding-vertical;
info@53
   249
        padding-bottom: @navbar-padding-vertical;
info@53
   250
      }
info@53
   251
    }
info@53
   252
info@53
   253
    &.navbar-right:last-child {
info@53
   254
      margin-right: -@navbar-padding-horizontal;
info@53
   255
    }
info@53
   256
  }
info@53
   257
}
info@53
   258
info@53
   259
info@53
   260
// Component alignment
info@53
   261
//
info@53
   262
// Repurpose the pull utilities as their own navbar utilities to avoid specificity
info@53
   263
// issues with parents and chaining. Only do this when the navbar is uncollapsed
info@53
   264
// though so that navbar contents properly stack and align in mobile.
info@53
   265
info@53
   266
@media (min-width: @grid-float-breakpoint) {
info@53
   267
  .navbar-left  { .pull-left(); }
info@53
   268
  .navbar-right { .pull-right(); }
info@53
   269
}
info@53
   270
info@53
   271
info@53
   272
// Navbar form
info@53
   273
//
info@53
   274
// Extension of the `.form-inline` with some extra flavor for optimum display in
info@53
   275
// our navbars.
info@53
   276
info@53
   277
.navbar-form {
info@53
   278
  margin-left: -@navbar-padding-horizontal;
info@53
   279
  margin-right: -@navbar-padding-horizontal;
info@53
   280
  padding: 10px @navbar-padding-horizontal;
info@53
   281
  border-top: 1px solid transparent;
info@53
   282
  border-bottom: 1px solid transparent;
info@53
   283
  @shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);
info@53
   284
  .box-shadow(@shadow);
info@53
   285
info@53
   286
  // Mixin behavior for optimum display
info@53
   287
  .form-inline();
info@53
   288
info@53
   289
  .form-group {
info@53
   290
    @media (max-width: @grid-float-breakpoint-max) {
info@53
   291
      margin-bottom: 5px;
info@53
   292
    }
info@53
   293
  }
info@53
   294
info@53
   295
  // Vertically center in expanded, horizontal navbar
info@53
   296
  .navbar-vertical-align(@input-height-base);
info@53
   297
info@53
   298
  // Undo 100% width for pull classes
info@53
   299
  @media (min-width: @grid-float-breakpoint) {
info@53
   300
    width: auto;
info@53
   301
    border: 0;
info@53
   302
    margin-left: 0;
info@53
   303
    margin-right: 0;
info@53
   304
    padding-top: 0;
info@53
   305
    padding-bottom: 0;
info@53
   306
    .box-shadow(none);
info@53
   307
info@53
   308
    // Outdent the form if last child to line up with content down the page
info@53
   309
    &.navbar-right:last-child {
info@53
   310
      margin-right: -@navbar-padding-horizontal;
info@53
   311
    }
info@53
   312
  }
info@53
   313
}
info@53
   314
info@53
   315
info@53
   316
// Dropdown menus
info@53
   317
info@53
   318
// Menu position and menu carets
info@53
   319
.navbar-nav > li > .dropdown-menu {
info@53
   320
  margin-top: 0;
info@53
   321
  .border-top-radius(0);
info@53
   322
}
info@53
   323
// Menu position and menu caret support for dropups via extra dropup class
info@53
   324
.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
info@53
   325
  .border-bottom-radius(0);
info@53
   326
}
info@53
   327
info@53
   328
// Right aligned menus need alt position
info@53
   329
.navbar-nav.pull-right > li > .dropdown-menu,
info@53
   330
.navbar-nav > li > .dropdown-menu.pull-right {
info@53
   331
  left: auto;
info@53
   332
  right: 0;
info@53
   333
}
info@53
   334
info@53
   335
info@53
   336
// Buttons in navbars
info@53
   337
//
info@53
   338
// Vertically center a button within a navbar (when *not* in a form).
info@53
   339
info@53
   340
.navbar-btn {
info@53
   341
  .navbar-vertical-align(@input-height-base);
info@53
   342
info@53
   343
  &.btn-sm {
info@53
   344
    .navbar-vertical-align(@input-height-small);
info@53
   345
  }
info@53
   346
  &.btn-xs {
info@53
   347
    .navbar-vertical-align(22);
info@53
   348
  }
info@53
   349
}
info@53
   350
info@53
   351
info@53
   352
// Text in navbars
info@53
   353
//
info@53
   354
// Add a class to make any element properly align itself vertically within the navbars.
info@53
   355
info@53
   356
.navbar-text {
info@53
   357
  .navbar-vertical-align(@line-height-computed);
info@53
   358
info@53
   359
  @media (min-width: @grid-float-breakpoint) {
info@53
   360
    float: left;
info@53
   361
    margin-left: @navbar-padding-horizontal;
info@53
   362
    margin-right: @navbar-padding-horizontal;
info@53
   363
info@53
   364
    // Outdent the form if last child to line up with content down the page
info@53
   365
    &.navbar-right:last-child {
info@53
   366
      margin-right: 0;
info@53
   367
    }
info@53
   368
  }
info@53
   369
}
info@53
   370
info@53
   371
// Alternate navbars
info@53
   372
// --------------------------------------------------
info@53
   373
info@53
   374
// Default navbar
info@53
   375
.navbar-default {
info@53
   376
  background-color: @navbar-default-bg;
info@53
   377
  border-color: @navbar-default-border;
info@53
   378
info@53
   379
  .navbar-brand {
info@53
   380
    color: @navbar-default-brand-color;
info@53
   381
    &:hover,
info@53
   382
    &:focus {
info@53
   383
      color: @navbar-default-brand-hover-color;
info@53
   384
      background-color: @navbar-default-brand-hover-bg;
info@53
   385
    }
info@53
   386
  }
info@53
   387
info@53
   388
  .navbar-text {
info@53
   389
    color: @navbar-default-color;
info@53
   390
  }
info@53
   391
info@53
   392
  .navbar-nav {
info@53
   393
    > li > a {
info@53
   394
      color: @navbar-default-link-color;
info@53
   395
info@53
   396
      &:hover,
info@53
   397
      &:focus {
info@53
   398
        color: @navbar-default-link-hover-color;
info@53
   399
        background-color: @navbar-default-link-hover-bg;
info@53
   400
      }
info@53
   401
    }
info@53
   402
    > .active > a {
info@53
   403
      &,
info@53
   404
      &:hover,
info@53
   405
      &:focus {
info@53
   406
        color: @navbar-default-link-active-color;
info@53
   407
        background-color: @navbar-default-link-active-bg;
info@53
   408
      }
info@53
   409
    }
info@53
   410
    > .disabled > a {
info@53
   411
      &,
info@53
   412
      &:hover,
info@53
   413
      &:focus {
info@53
   414
        color: @navbar-default-link-disabled-color;
info@53
   415
        background-color: @navbar-default-link-disabled-bg;
info@53
   416
      }
info@53
   417
    }
info@53
   418
  }
info@53
   419
info@53
   420
  .navbar-toggle {
info@53
   421
    border-color: @navbar-default-toggle-border-color;
info@53
   422
    &:hover,
info@53
   423
    &:focus {
info@53
   424
      background-color: @navbar-default-toggle-hover-bg;
info@53
   425
    }
info@53
   426
    .icon-bar {
info@53
   427
      background-color: @navbar-default-toggle-icon-bar-bg;
info@53
   428
    }
info@53
   429
  }
info@53
   430
info@53
   431
  .navbar-collapse,
info@53
   432
  .navbar-form {
info@53
   433
    border-color: @navbar-default-border;
info@53
   434
  }
info@53
   435
info@53
   436
  // Dropdown menu items
info@53
   437
  .navbar-nav {
info@53
   438
    // Remove background color from open dropdown
info@53
   439
    > .open > a {
info@53
   440
      &,
info@53
   441
      &:hover,
info@53
   442
      &:focus {
info@53
   443
        background-color: @navbar-default-link-active-bg;
info@53
   444
        color: @navbar-default-link-active-color;
info@53
   445
      }
info@53
   446
    }
info@53
   447
info@53
   448
    @media (max-width: @grid-float-breakpoint-max) {
info@53
   449
      // Dropdowns get custom display when collapsed
info@53
   450
      .open .dropdown-menu {
info@53
   451
        > li > a {
info@53
   452
          color: @navbar-default-link-color;
info@53
   453
          &:hover,
info@53
   454
          &:focus {
info@53
   455
            color: @navbar-default-link-hover-color;
info@53
   456
            background-color: @navbar-default-link-hover-bg;
info@53
   457
          }
info@53
   458
        }
info@53
   459
        > .active > a {
info@53
   460
          &,
info@53
   461
          &:hover,
info@53
   462
          &:focus {
info@53
   463
            color: @navbar-default-link-active-color;
info@53
   464
            background-color: @navbar-default-link-active-bg;
info@53
   465
          }
info@53
   466
        }
info@53
   467
        > .disabled > a {
info@53
   468
          &,
info@53
   469
          &:hover,
info@53
   470
          &:focus {
info@53
   471
            color: @navbar-default-link-disabled-color;
info@53
   472
            background-color: @navbar-default-link-disabled-bg;
info@53
   473
          }
info@53
   474
        }
info@53
   475
      }
info@53
   476
    }
info@53
   477
  }
info@53
   478
info@53
   479
info@53
   480
  // Links in navbars
info@53
   481
  //
info@53
   482
  // Add a class to ensure links outside the navbar nav are colored correctly.
info@53
   483
info@53
   484
  .navbar-link {
info@53
   485
    color: @navbar-default-link-color;
info@53
   486
    &:hover {
info@53
   487
      color: @navbar-default-link-hover-color;
info@53
   488
    }
info@53
   489
  }
info@53
   490
info@53
   491
}
info@53
   492
info@53
   493
// Inverse navbar
info@53
   494
info@53
   495
.navbar-inverse {
info@53
   496
  background-color: @navbar-inverse-bg;
info@53
   497
  border-color: @navbar-inverse-border;
info@53
   498
info@53
   499
  .navbar-brand {
info@53
   500
    color: @navbar-inverse-brand-color;
info@53
   501
    &:hover,
info@53
   502
    &:focus {
info@53
   503
      color: @navbar-inverse-brand-hover-color;
info@53
   504
      background-color: @navbar-inverse-brand-hover-bg;
info@53
   505
    }
info@53
   506
  }
info@53
   507
info@53
   508
  .navbar-text {
info@53
   509
    color: @navbar-inverse-color;
info@53
   510
  }
info@53
   511
info@53
   512
  .navbar-nav {
info@53
   513
    > li > a {
info@53
   514
      color: @navbar-inverse-link-color;
info@53
   515
info@53
   516
      &:hover,
info@53
   517
      &:focus {
info@53
   518
        color: @navbar-inverse-link-hover-color;
info@53
   519
        background-color: @navbar-inverse-link-hover-bg;
info@53
   520
      }
info@53
   521
    }
info@53
   522
    > .active > a {
info@53
   523
      &,
info@53
   524
      &:hover,
info@53
   525
      &:focus {
info@53
   526
        color: @navbar-inverse-link-active-color;
info@53
   527
        background-color: @navbar-inverse-link-active-bg;
info@53
   528
      }
info@53
   529
    }
info@53
   530
    > .disabled > a {
info@53
   531
      &,
info@53
   532
      &:hover,
info@53
   533
      &:focus {
info@53
   534
        color: @navbar-inverse-link-disabled-color;
info@53
   535
        background-color: @navbar-inverse-link-disabled-bg;
info@53
   536
      }
info@53
   537
    }
info@53
   538
  }
info@53
   539
info@53
   540
  // Darken the responsive nav toggle
info@53
   541
  .navbar-toggle {
info@53
   542
    border-color: @navbar-inverse-toggle-border-color;
info@53
   543
    &:hover,
info@53
   544
    &:focus {
info@53
   545
      background-color: @navbar-inverse-toggle-hover-bg;
info@53
   546
    }
info@53
   547
    .icon-bar {
info@53
   548
      background-color: @navbar-inverse-toggle-icon-bar-bg;
info@53
   549
    }
info@53
   550
  }
info@53
   551
info@53
   552
  .navbar-collapse,
info@53
   553
  .navbar-form {
info@53
   554
    border-color: darken(@navbar-inverse-bg, 7%);
info@53
   555
  }
info@53
   556
info@53
   557
  // Dropdowns
info@53
   558
  .navbar-nav {
info@53
   559
    > .open > a {
info@53
   560
      &,
info@53
   561
      &:hover,
info@53
   562
      &:focus {
info@53
   563
        background-color: @navbar-inverse-link-active-bg;
info@53
   564
        color: @navbar-inverse-link-active-color;
info@53
   565
      }
info@53
   566
    }
info@53
   567
info@53
   568
    @media (max-width: @grid-float-breakpoint-max) {
info@53
   569
      // Dropdowns get custom display
info@53
   570
      .open .dropdown-menu {
info@53
   571
        > .dropdown-header {
info@53
   572
          border-color: @navbar-inverse-border;
info@53
   573
        }
info@53
   574
        .divider {
info@53
   575
          background-color: @navbar-inverse-border;
info@53
   576
        }
info@53
   577
        > li > a {
info@53
   578
          color: @navbar-inverse-link-color;
info@53
   579
          &:hover,
info@53
   580
          &:focus {
info@53
   581
            color: @navbar-inverse-link-hover-color;
info@53
   582
            background-color: @navbar-inverse-link-hover-bg;
info@53
   583
          }
info@53
   584
        }
info@53
   585
        > .active > a {
info@53
   586
          &,
info@53
   587
          &:hover,
info@53
   588
          &:focus {
info@53
   589
            color: @navbar-inverse-link-active-color;
info@53
   590
            background-color: @navbar-inverse-link-active-bg;
info@53
   591
          }
info@53
   592
        }
info@53
   593
        > .disabled > a {
info@53
   594
          &,
info@53
   595
          &:hover,
info@53
   596
          &:focus {
info@53
   597
            color: @navbar-inverse-link-disabled-color;
info@53
   598
            background-color: @navbar-inverse-link-disabled-bg;
info@53
   599
          }
info@53
   600
        }
info@53
   601
      }
info@53
   602
    }
info@53
   603
  }
info@53
   604
info@53
   605
  .navbar-link {
info@53
   606
    color: @navbar-inverse-link-color;
info@53
   607
    &:hover {
info@53
   608
      color: @navbar-inverse-link-hover-color;
info@53
   609
    }
info@53
   610
  }
info@53
   611
info@53
   612
}
Impressum Datenschutzerklärung