bootstrap-source/bootstrap-3.0.3/less/dropdowns.less
author stetrabby <info@trabucchi.de>
Fri, 20 Dec 2013 22:49:16 +0100
changeset 54 0ded9d7748b7
permissions -rwxr-xr-x
initial less based on the pymove3d.css
info@54
     1
//
info@54
     2
// Dropdown menus
info@54
     3
// --------------------------------------------------
info@54
     4
info@54
     5
info@54
     6
// Dropdown arrow/caret
info@54
     7
.caret {
info@54
     8
  display: inline-block;
info@54
     9
  width: 0;
info@54
    10
  height: 0;
info@54
    11
  margin-left: 2px;
info@54
    12
  vertical-align: middle;
info@54
    13
  border-top:   @caret-width-base solid;
info@54
    14
  border-right: @caret-width-base solid transparent;
info@54
    15
  border-left:  @caret-width-base solid transparent;
info@54
    16
}
info@54
    17
info@54
    18
// The dropdown wrapper (div)
info@54
    19
.dropdown {
info@54
    20
  position: relative;
info@54
    21
}
info@54
    22
info@54
    23
// Prevent the focus on the dropdown toggle when closing dropdowns
info@54
    24
.dropdown-toggle:focus {
info@54
    25
  outline: 0;
info@54
    26
}
info@54
    27
info@54
    28
// The dropdown menu (ul)
info@54
    29
.dropdown-menu {
info@54
    30
  position: absolute;
info@54
    31
  top: 100%;
info@54
    32
  left: 0;
info@54
    33
  z-index: @zindex-dropdown;
info@54
    34
  display: none; // none by default, but block on "open" of the menu
info@54
    35
  float: left;
info@54
    36
  min-width: 160px;
info@54
    37
  padding: 5px 0;
info@54
    38
  margin: 2px 0 0; // override default ul
info@54
    39
  list-style: none;
info@54
    40
  font-size: @font-size-base;
info@54
    41
  background-color: @dropdown-bg;
info@54
    42
  border: 1px solid @dropdown-fallback-border; // IE8 fallback
info@54
    43
  border: 1px solid @dropdown-border;
info@54
    44
  border-radius: @border-radius-base;
info@54
    45
  .box-shadow(0 6px 12px rgba(0,0,0,.175));
info@54
    46
  background-clip: padding-box;
info@54
    47
info@54
    48
  // Aligns the dropdown menu to right
info@54
    49
  &.pull-right {
info@54
    50
    right: 0;
info@54
    51
    left: auto;
info@54
    52
  }
info@54
    53
info@54
    54
  // Dividers (basically an hr) within the dropdown
info@54
    55
  .divider {
info@54
    56
    .nav-divider(@dropdown-divider-bg);
info@54
    57
  }
info@54
    58
info@54
    59
  // Links within the dropdown menu
info@54
    60
  > li > a {
info@54
    61
    display: block;
info@54
    62
    padding: 3px 20px;
info@54
    63
    clear: both;
info@54
    64
    font-weight: normal;
info@54
    65
    line-height: @line-height-base;
info@54
    66
    color: @dropdown-link-color;
info@54
    67
    white-space: nowrap; // prevent links from randomly breaking onto new lines
info@54
    68
  }
info@54
    69
}
info@54
    70
info@54
    71
// Hover/Focus state
info@54
    72
.dropdown-menu > li > a {
info@54
    73
  &:hover,
info@54
    74
  &:focus {
info@54
    75
    text-decoration: none;
info@54
    76
    color: @dropdown-link-hover-color;
info@54
    77
    background-color: @dropdown-link-hover-bg;
info@54
    78
  }
info@54
    79
}
info@54
    80
info@54
    81
// Active state
info@54
    82
.dropdown-menu > .active > a {
info@54
    83
  &,
info@54
    84
  &:hover,
info@54
    85
  &:focus {
info@54
    86
    color: @dropdown-link-active-color;
info@54
    87
    text-decoration: none;
info@54
    88
    outline: 0;
info@54
    89
    background-color: @dropdown-link-active-bg;
info@54
    90
  }
info@54
    91
}
info@54
    92
info@54
    93
// Disabled state
info@54
    94
//
info@54
    95
// Gray out text and ensure the hover/focus state remains gray
info@54
    96
info@54
    97
.dropdown-menu > .disabled > a {
info@54
    98
  &,
info@54
    99
  &:hover,
info@54
   100
  &:focus {
info@54
   101
    color: @dropdown-link-disabled-color;
info@54
   102
  }
info@54
   103
}
info@54
   104
// Nuke hover/focus effects
info@54
   105
.dropdown-menu > .disabled > a {
info@54
   106
  &:hover,
info@54
   107
  &:focus {
info@54
   108
    text-decoration: none;
info@54
   109
    background-color: transparent;
info@54
   110
    background-image: none; // Remove CSS gradient
info@54
   111
    .reset-filter();
info@54
   112
    cursor: not-allowed;
info@54
   113
  }
info@54
   114
}
info@54
   115
info@54
   116
// Open state for the dropdown
info@54
   117
.open {
info@54
   118
  // Show the menu
info@54
   119
  > .dropdown-menu {
info@54
   120
    display: block;
info@54
   121
  }
info@54
   122
info@54
   123
  // Remove the outline when :focus is triggered
info@54
   124
  > a {
info@54
   125
    outline: 0;
info@54
   126
  }
info@54
   127
}
info@54
   128
info@54
   129
// Dropdown section headers
info@54
   130
.dropdown-header {
info@54
   131
  display: block;
info@54
   132
  padding: 3px 20px;
info@54
   133
  font-size: @font-size-small;
info@54
   134
  line-height: @line-height-base;
info@54
   135
  color: @dropdown-header-color;
info@54
   136
}
info@54
   137
info@54
   138
// Backdrop to catch body clicks on mobile, etc.
info@54
   139
.dropdown-backdrop {
info@54
   140
  position: fixed;
info@54
   141
  left: 0;
info@54
   142
  right: 0;
info@54
   143
  bottom: 0;
info@54
   144
  top: 0;
info@54
   145
  z-index: @zindex-dropdown - 10;
info@54
   146
}
info@54
   147
info@54
   148
// Right aligned dropdowns
info@54
   149
.pull-right > .dropdown-menu {
info@54
   150
  right: 0;
info@54
   151
  left: auto;
info@54
   152
}
info@54
   153
info@54
   154
// Allow for dropdowns to go bottom up (aka, dropup-menu)
info@54
   155
//
info@54
   156
// Just add .dropup after the standard .dropdown class and you're set, bro.
info@54
   157
// TODO: abstract this so that the navbar fixed styles are not placed here?
info@54
   158
info@54
   159
.dropup,
info@54
   160
.navbar-fixed-bottom .dropdown {
info@54
   161
  // Reverse the caret
info@54
   162
  .caret {
info@54
   163
    border-top: 0;
info@54
   164
    border-bottom: @caret-width-base solid;
info@54
   165
    content: "";
info@54
   166
  }
info@54
   167
  // Different positioning for bottom up menu
info@54
   168
  .dropdown-menu {
info@54
   169
    top: auto;
info@54
   170
    bottom: 100%;
info@54
   171
    margin-bottom: 1px;
info@54
   172
  }
info@54
   173
}
info@54
   174
info@54
   175
info@54
   176
// Component alignment
info@54
   177
//
info@54
   178
// Reiterate per navbar.less and the modified component alignment there.
info@54
   179
info@54
   180
@media (min-width: @grid-float-breakpoint) {
info@54
   181
  .navbar-right {
info@54
   182
    .dropdown-menu {
info@54
   183
      .pull-right > .dropdown-menu();
info@54
   184
    }
info@54
   185
  }
info@54
   186
}
info@54
   187
Impressum Datenschutzerklärung