twitter-bootstrap-rails 2.2.3 → 3.2.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of twitter-bootstrap-rails might be problematic. Click here for more details.

Files changed (204) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +460 -185
  3. data/Rakefile +7 -1
  4. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  5. data/app/assets/fonts/fontawesome-webfont.svg +640 -0
  6. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  7. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  8. data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  9. data/app/assets/fonts/glyphicons-halflings-regular.svg +229 -0
  10. data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  11. data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  12. data/app/assets/javascripts/twitter/bootstrap.js +12 -0
  13. data/app/assets/javascripts/twitter/bootstrap/affix.js +142 -0
  14. data/app/assets/javascripts/twitter/bootstrap/alert.js +92 -0
  15. data/app/assets/javascripts/twitter/bootstrap/button.js +110 -0
  16. data/app/assets/javascripts/twitter/bootstrap/carousel.js +223 -0
  17. data/app/assets/javascripts/twitter/bootstrap/collapse.js +170 -0
  18. data/app/assets/javascripts/twitter/bootstrap/dropdown.js +151 -0
  19. data/app/assets/javascripts/twitter/bootstrap/modal.js +280 -0
  20. data/app/assets/javascripts/twitter/bootstrap/popover.js +113 -0
  21. data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +170 -0
  22. data/app/assets/javascripts/twitter/bootstrap/tab.js +128 -0
  23. data/app/assets/javascripts/twitter/bootstrap/tooltip.js +457 -0
  24. data/app/assets/javascripts/twitter/bootstrap/transition.js +59 -0
  25. data/{vendor → app}/assets/javascripts/twitter/bootstrap_ujs.js +0 -0
  26. data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +1 -0
  27. data/app/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +2026 -0
  28. data/app/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +1 -0
  29. data/app/helpers/badge_label_helper.rb +16 -0
  30. data/app/helpers/bootstrap_flash_helper.rb +20 -6
  31. data/app/helpers/form_errors_helper.rb +22 -0
  32. data/app/helpers/glyph_helper.rb +13 -5
  33. data/app/helpers/modal_helper.rb +37 -20
  34. data/app/helpers/navbar_helper.rb +209 -0
  35. data/app/helpers/twitter_breadcrumbs_helper.rb +11 -2
  36. data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +9 -9
  37. data/lib/generators/bootstrap/install/install_generator.rb +13 -8
  38. data/lib/generators/bootstrap/install/templates/bootstrap.coffee +2 -3
  39. data/lib/generators/bootstrap/install/templates/bootstrap.js +2 -3
  40. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +14 -13
  41. data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +11 -5
  42. data/lib/generators/bootstrap/layout/layout_generator.rb +1 -4
  43. data/lib/generators/bootstrap/layout/templates/layout.html.erb +34 -58
  44. data/lib/generators/bootstrap/layout/templates/layout.html.haml +25 -44
  45. data/lib/generators/bootstrap/layout/templates/layout.html.slim +20 -39
  46. data/lib/generators/bootstrap/partial/templates/_login.html.erb +2 -3
  47. data/lib/generators/bootstrap/themed/templates/_form.html.erb +30 -10
  48. data/lib/generators/bootstrap/themed/templates/_form.html.haml +10 -8
  49. data/lib/generators/bootstrap/themed/templates/_form.html.slim +11 -9
  50. data/lib/generators/bootstrap/themed/templates/edit.html.erb +1 -2
  51. data/lib/generators/bootstrap/themed/templates/edit.html.haml +1 -1
  52. data/lib/generators/bootstrap/themed/templates/edit.html.slim +2 -2
  53. data/lib/generators/bootstrap/themed/templates/index.html.erb +3 -3
  54. data/lib/generators/bootstrap/themed/templates/index.html.haml +3 -3
  55. data/lib/generators/bootstrap/themed/templates/index.html.slim +5 -6
  56. data/lib/generators/bootstrap/themed/templates/new.html.erb +1 -2
  57. data/lib/generators/bootstrap/themed/templates/new.html.haml +1 -1
  58. data/lib/generators/bootstrap/themed/templates/new.html.slim +2 -2
  59. data/lib/generators/bootstrap/themed/templates/show.html.erb +6 -8
  60. data/lib/generators/bootstrap/themed/templates/show.html.haml +5 -5
  61. data/lib/generators/bootstrap/themed/templates/show.html.slim +7 -8
  62. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +5 -5
  63. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +3 -3
  64. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +4 -4
  65. data/lib/generators/bootstrap/themed/themed_generator.rb +4 -4
  66. data/lib/twitter-bootstrap-rails.rb +4 -4
  67. data/lib/twitter/bootstrap/rails/breadcrumbs.rb +69 -0
  68. data/lib/twitter/bootstrap/rails/engine.rb +17 -7
  69. data/lib/twitter/bootstrap/rails/version.rb +1 -1
  70. data/spec/lib/breadcrumbs_spec.rb +99 -0
  71. data/spec/lib/twitter_bootstrap_rails/badge_label_helper_spec.rb +30 -0
  72. data/spec/lib/twitter_bootstrap_rails/bootstrap_flash_helper_spec.rb +128 -0
  73. data/spec/lib/twitter_bootstrap_rails/form_errors_helper_spec.rb +148 -0
  74. data/spec/lib/twitter_bootstrap_rails/glyph_helper_spec.rb +24 -0
  75. data/spec/lib/twitter_bootstrap_rails/modal_helper_spec.rb +62 -0
  76. data/spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb +396 -0
  77. data/spec/lib/twitter_bootstrap_rails/uri_state_spec.rb +49 -0
  78. data/spec/spec_helper.rb +21 -0
  79. data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +5990 -195
  80. data/vendor/static-source/bootstrap.less +0 -1
  81. data/vendor/static-source/fontawesome.less +7 -6
  82. data/vendor/static-source/sprites.less +3 -3
  83. data/vendor/toolkit/fontawesome/bordered-pulled.less +16 -0
  84. data/vendor/toolkit/fontawesome/core.less +11 -0
  85. data/vendor/toolkit/fontawesome/fixed-width.less +6 -0
  86. data/vendor/toolkit/fontawesome/font-awesome.less +17 -0
  87. data/vendor/toolkit/fontawesome/icons.less +552 -0
  88. data/vendor/toolkit/fontawesome/larger.less +13 -0
  89. data/vendor/toolkit/fontawesome/list.less +19 -0
  90. data/vendor/toolkit/fontawesome/mixins.less +25 -0
  91. data/vendor/toolkit/fontawesome/path.less +14 -0
  92. data/vendor/toolkit/fontawesome/rotated-flipped.less +20 -0
  93. data/vendor/toolkit/fontawesome/spinning.less +29 -0
  94. data/vendor/toolkit/fontawesome/stacked.less +20 -0
  95. data/vendor/toolkit/fontawesome/variables.less +561 -0
  96. data/vendor/toolkit/twitter/bootstrap/alerts.less +47 -58
  97. data/vendor/toolkit/twitter/bootstrap/badges.less +55 -0
  98. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +26 -39
  99. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +11 -9
  100. data/vendor/toolkit/twitter/bootstrap/button-groups.less +168 -152
  101. data/vendor/toolkit/twitter/bootstrap/buttons.less +101 -170
  102. data/vendor/toolkit/twitter/bootstrap/carousel.less +150 -65
  103. data/vendor/toolkit/twitter/bootstrap/close.less +20 -19
  104. data/vendor/toolkit/twitter/bootstrap/code.less +38 -30
  105. data/vendor/toolkit/twitter/bootstrap/component-animations.less +12 -3
  106. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +124 -146
  107. data/vendor/toolkit/twitter/bootstrap/forms.less +401 -547
  108. data/vendor/toolkit/twitter/bootstrap/glyphicons.less +234 -0
  109. data/vendor/toolkit/twitter/bootstrap/grid.less +74 -11
  110. data/vendor/toolkit/twitter/bootstrap/input-groups.less +166 -0
  111. data/vendor/toolkit/twitter/bootstrap/jumbotron.less +48 -0
  112. data/vendor/toolkit/twitter/bootstrap/labels.less +64 -0
  113. data/vendor/toolkit/twitter/bootstrap/list-group.less +132 -0
  114. data/vendor/toolkit/twitter/bootstrap/media.less +8 -7
  115. data/vendor/toolkit/twitter/bootstrap/mixins.less +36 -699
  116. data/vendor/toolkit/twitter/bootstrap/mixins/alerts.less +14 -0
  117. data/vendor/toolkit/twitter/bootstrap/mixins/background-variant.less +8 -0
  118. data/vendor/toolkit/twitter/bootstrap/mixins/border-radius.less +18 -0
  119. data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +52 -0
  120. data/vendor/toolkit/twitter/bootstrap/mixins/center-block.less +7 -0
  121. data/vendor/toolkit/twitter/bootstrap/mixins/clearfix.less +22 -0
  122. data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +85 -0
  123. data/vendor/toolkit/twitter/bootstrap/mixins/gradients.less +59 -0
  124. data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +91 -0
  125. data/vendor/toolkit/twitter/bootstrap/mixins/grid.less +122 -0
  126. data/vendor/toolkit/twitter/bootstrap/mixins/hide-text.less +21 -0
  127. data/vendor/toolkit/twitter/bootstrap/mixins/image.less +33 -0
  128. data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +12 -0
  129. data/vendor/toolkit/twitter/bootstrap/mixins/list-group.less +29 -0
  130. data/vendor/toolkit/twitter/bootstrap/mixins/nav-divider.less +10 -0
  131. data/vendor/toolkit/twitter/bootstrap/mixins/nav-vertical-align.less +9 -0
  132. data/vendor/toolkit/twitter/bootstrap/mixins/opacity.less +8 -0
  133. data/vendor/toolkit/twitter/bootstrap/mixins/pagination.less +23 -0
  134. data/vendor/toolkit/twitter/bootstrap/mixins/panels.less +24 -0
  135. data/vendor/toolkit/twitter/bootstrap/mixins/progress-bar.less +10 -0
  136. data/vendor/toolkit/twitter/bootstrap/mixins/reset-filter.less +8 -0
  137. data/vendor/toolkit/twitter/bootstrap/mixins/resize.less +6 -0
  138. data/vendor/toolkit/twitter/bootstrap/mixins/responsive-visibility.less +15 -0
  139. data/vendor/toolkit/twitter/bootstrap/mixins/size.less +10 -0
  140. data/vendor/toolkit/twitter/bootstrap/mixins/tab-focus.less +9 -0
  141. data/vendor/toolkit/twitter/bootstrap/mixins/table-row.less +28 -0
  142. data/vendor/toolkit/twitter/bootstrap/mixins/text-emphasis.less +8 -0
  143. data/vendor/toolkit/twitter/bootstrap/mixins/text-overflow.less +8 -0
  144. data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +224 -0
  145. data/vendor/toolkit/twitter/bootstrap/modals.less +109 -54
  146. data/vendor/toolkit/twitter/bootstrap/navbar.less +542 -384
  147. data/vendor/toolkit/twitter/bootstrap/navs.less +192 -359
  148. data/vendor/toolkit/twitter/bootstrap/normalize.less +425 -0
  149. data/vendor/toolkit/twitter/bootstrap/pager.less +46 -34
  150. data/vendor/toolkit/twitter/bootstrap/pagination.less +70 -105
  151. data/vendor/toolkit/twitter/bootstrap/panels.less +248 -0
  152. data/vendor/toolkit/twitter/bootstrap/popovers.less +61 -61
  153. data/vendor/toolkit/twitter/bootstrap/print.less +101 -0
  154. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +51 -73
  155. data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +34 -0
  156. data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +177 -42
  157. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +120 -23
  158. data/vendor/toolkit/twitter/bootstrap/tables.less +171 -182
  159. data/vendor/toolkit/twitter/bootstrap/theme.less +260 -0
  160. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +26 -43
  161. data/vendor/toolkit/twitter/bootstrap/tooltip.less +49 -24
  162. data/vendor/toolkit/twitter/bootstrap/type.less +208 -147
  163. data/vendor/toolkit/twitter/bootstrap/utilities.less +33 -7
  164. data/vendor/toolkit/twitter/bootstrap/variables.less +761 -215
  165. data/vendor/toolkit/twitter/bootstrap/wells.less +7 -7
  166. metadata +199 -92
  167. data/lib/generators/bootstrap/partial/templates/_navbar.html.erb +0 -13
  168. data/lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb +0 -42
  169. data/test/lib/breadcrumbs_test.rb +0 -75
  170. data/test/test_helper.rb +0 -8
  171. data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
  172. data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
  173. data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
  174. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  175. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  176. data/vendor/assets/javascripts/twitter/bootstrap.js +0 -13
  177. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-affix.js +0 -117
  178. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +0 -99
  179. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-button.js +0 -105
  180. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +0 -207
  181. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +0 -167
  182. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +0 -165
  183. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +0 -247
  184. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +0 -114
  185. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +0 -162
  186. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +0 -144
  187. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +0 -353
  188. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +0 -60
  189. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +0 -335
  190. data/vendor/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +0 -531
  191. data/vendor/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +0 -146
  192. data/vendor/toolkit/fontawesome-ie7.less +0 -350
  193. data/vendor/toolkit/fontawesome.less +0 -532
  194. data/vendor/toolkit/twitter/bootstrap/accordion.less +0 -34
  195. data/vendor/toolkit/twitter/bootstrap/hero-unit.less +0 -25
  196. data/vendor/toolkit/twitter/bootstrap/labels-badges.less +0 -84
  197. data/vendor/toolkit/twitter/bootstrap/layouts.less +0 -16
  198. data/vendor/toolkit/twitter/bootstrap/reset.less +0 -216
  199. data/vendor/toolkit/twitter/bootstrap/responsive-1200px-min.less +0 -28
  200. data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +0 -193
  201. data/vendor/toolkit/twitter/bootstrap/responsive-768px-979px.less +0 -19
  202. data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +0 -189
  203. data/vendor/toolkit/twitter/bootstrap/responsive.less +0 -48
  204. data/vendor/toolkit/twitter/bootstrap/sprites.less +0 -197
@@ -5,28 +5,29 @@
5
5
 
6
6
  .close {
7
7
  float: right;
8
- font-size: 20px;
9
- font-weight: bold;
10
- line-height: @baseLineHeight;
11
- color: @black;
12
- text-shadow: 0 1px 0 rgba(255,255,255,1);
13
- .opacity(20);
8
+ font-size: (@font-size-base * 1.5);
9
+ font-weight: @close-font-weight;
10
+ line-height: 1;
11
+ color: @close-color;
12
+ text-shadow: @close-text-shadow;
13
+ .opacity(.2);
14
+
14
15
  &:hover,
15
16
  &:focus {
16
- color: @black;
17
+ color: @close-color;
17
18
  text-decoration: none;
18
19
  cursor: pointer;
19
- .opacity(40);
20
+ .opacity(.5);
20
21
  }
21
- }
22
22
 
23
- // Additional properties for button version
24
- // iOS requires the button element instead of an anchor tag.
25
- // If you want the anchor version, it requires `href="#"`.
26
- button.close {
27
- padding: 0;
28
- cursor: pointer;
29
- background: transparent;
30
- border: 0;
31
- -webkit-appearance: none;
32
- }
23
+ // Additional properties for button version
24
+ // iOS requires the button element instead of an anchor tag.
25
+ // If you want the anchor version, it requires `href="#"`.
26
+ button& {
27
+ padding: 0;
28
+ cursor: pointer;
29
+ background: transparent;
30
+ border: 0;
31
+ -webkit-appearance: none;
32
+ }
33
+ }
@@ -1,61 +1,69 @@
1
1
  //
2
- // Code (inline and blocK)
2
+ // Code (inline and block)
3
3
  // --------------------------------------------------
4
4
 
5
5
 
6
6
  // Inline and block code styles
7
7
  code,
8
- pre {
9
- padding: 0 3px 2px;
10
- #font > #family > .monospace;
11
- font-size: @baseFontSize - 2;
12
- color: @grayDark;
13
- .border-radius(3px);
8
+ kbd,
9
+ pre,
10
+ samp {
11
+ font-family: @font-family-monospace;
14
12
  }
15
13
 
16
14
  // Inline code
17
15
  code {
18
16
  padding: 2px 4px;
19
- color: #d14;
20
- background-color: #f7f7f9;
21
- border: 1px solid #e1e1e8;
22
- white-space: nowrap;
17
+ font-size: 90%;
18
+ color: @code-color;
19
+ background-color: @code-bg;
20
+ border-radius: @border-radius-base;
21
+ }
22
+
23
+ // User input typically entered via keyboard
24
+ kbd {
25
+ padding: 2px 4px;
26
+ font-size: 90%;
27
+ color: @kbd-color;
28
+ background-color: @kbd-bg;
29
+ border-radius: @border-radius-small;
30
+ box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);
31
+
32
+ kbd {
33
+ padding: 0;
34
+ font-size: 100%;
35
+ font-weight: bold;
36
+ box-shadow: none;
37
+ }
23
38
  }
24
39
 
25
40
  // Blocks of code
26
41
  pre {
27
42
  display: block;
28
- padding: (@baseLineHeight - 1) / 2;
29
- margin: 0 0 @baseLineHeight / 2;
30
- font-size: @baseFontSize - 1; // 14px to 13px
31
- line-height: @baseLineHeight;
43
+ padding: ((@line-height-computed - 1) / 2);
44
+ margin: 0 0 (@line-height-computed / 2);
45
+ font-size: (@font-size-base - 1); // 14px to 13px
46
+ line-height: @line-height-base;
32
47
  word-break: break-all;
33
48
  word-wrap: break-word;
34
- white-space: pre;
35
- white-space: pre-wrap;
36
- background-color: #f5f5f5;
37
- border: 1px solid #ccc; // fallback for IE7-8
38
- border: 1px solid rgba(0,0,0,.15);
39
- .border-radius(@baseBorderRadius);
40
-
41
- // Make prettyprint styles more spaced out for readability
42
- &.prettyprint {
43
- margin-bottom: @baseLineHeight;
44
- }
49
+ color: @pre-color;
50
+ background-color: @pre-bg;
51
+ border: 1px solid @pre-border-color;
52
+ border-radius: @border-radius-base;
45
53
 
46
54
  // Account for some code outputs that place code tags in pre tags
47
55
  code {
48
56
  padding: 0;
57
+ font-size: inherit;
49
58
  color: inherit;
50
- white-space: pre;
51
59
  white-space: pre-wrap;
52
60
  background-color: transparent;
53
- border: 0;
61
+ border-radius: 0;
54
62
  }
55
63
  }
56
64
 
57
65
  // Enable scrollable blocks of code
58
66
  .pre-scrollable {
59
- max-height: 340px;
67
+ max-height: @pre-scrollable-max-height;
60
68
  overflow-y: scroll;
61
- }
69
+ }
@@ -2,6 +2,10 @@
2
2
  // Component animations
3
3
  // --------------------------------------------------
4
4
 
5
+ // Heads up!
6
+ //
7
+ // We don't use the `.opacity()` mixin here since it causes a bug with text
8
+ // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552.
5
9
 
6
10
  .fade {
7
11
  opacity: 0;
@@ -12,11 +16,16 @@
12
16
  }
13
17
 
14
18
  .collapse {
19
+ display: none;
20
+
21
+ &.in { display: block; }
22
+ tr&.in { display: table-row; }
23
+ tbody&.in { display: table-row-group; }
24
+ }
25
+
26
+ .collapsing {
15
27
  position: relative;
16
28
  height: 0;
17
29
  overflow: hidden;
18
30
  .transition(height .35s ease);
19
- &.in {
20
- height: auto;
21
- }
22
31
  }
@@ -3,64 +3,52 @@
3
3
  // --------------------------------------------------
4
4
 
5
5
 
6
- // Use the .menu class on any <li> element within the topbar or ul.tabs and you'll get some superfancy dropdowns
7
- .dropup,
8
- .dropdown {
9
- position: relative;
10
- }
11
- .dropdown-toggle {
12
- // The caret makes the toggle a bit too tall in IE7
13
- *margin-bottom: -3px;
14
- }
15
- .dropdown-toggle:active,
16
- .open .dropdown-toggle {
17
- outline: 0;
18
- }
19
-
20
6
  // Dropdown arrow/caret
21
- // --------------------
22
7
  .caret {
23
8
  display: inline-block;
24
9
  width: 0;
25
10
  height: 0;
26
- vertical-align: top;
27
- border-top: 4px solid @black;
28
- border-right: 4px solid transparent;
29
- border-left: 4px solid transparent;
30
- content: "";
11
+ margin-left: 2px;
12
+ vertical-align: middle;
13
+ border-top: @caret-width-base solid;
14
+ border-right: @caret-width-base solid transparent;
15
+ border-left: @caret-width-base solid transparent;
31
16
  }
32
17
 
33
- // Place the caret
34
- .dropdown .caret {
35
- margin-top: 8px;
36
- margin-left: 2px;
18
+ // The dropdown wrapper (div)
19
+ .dropdown {
20
+ position: relative;
21
+ }
22
+
23
+ // Prevent the focus on the dropdown toggle when closing dropdowns
24
+ .dropdown-toggle:focus {
25
+ outline: 0;
37
26
  }
38
27
 
39
28
  // The dropdown menu (ul)
40
- // ----------------------
41
29
  .dropdown-menu {
42
30
  position: absolute;
43
31
  top: 100%;
44
32
  left: 0;
45
- z-index: @zindexDropdown;
33
+ z-index: @zindex-dropdown;
46
34
  display: none; // none by default, but block on "open" of the menu
47
35
  float: left;
48
36
  min-width: 160px;
49
37
  padding: 5px 0;
50
38
  margin: 2px 0 0; // override default ul
51
39
  list-style: none;
52
- background-color: @dropdownBackground;
53
- border: 1px solid #ccc; // Fallback for IE7-8
54
- border: 1px solid @dropdownBorder;
55
- *border-right-width: 2px;
56
- *border-bottom-width: 2px;
57
- .border-radius(6px);
58
- .box-shadow(0 5px 10px rgba(0,0,0,.2));
59
- -webkit-background-clip: padding-box;
60
- -moz-background-clip: padding;
61
- background-clip: padding-box;
40
+ font-size: @font-size-base;
41
+ text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
42
+ background-color: @dropdown-bg;
43
+ border: 1px solid @dropdown-fallback-border; // IE8 fallback
44
+ border: 1px solid @dropdown-border;
45
+ border-radius: @border-radius-base;
46
+ .box-shadow(0 6px 12px rgba(0,0,0,.175));
47
+ background-clip: padding-box;
62
48
 
63
49
  // Aligns the dropdown menu to right
50
+ //
51
+ // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]`
64
52
  &.pull-right {
65
53
  right: 0;
66
54
  left: auto;
@@ -68,7 +56,7 @@
68
56
 
69
57
  // Dividers (basically an hr) within the dropdown
70
58
  .divider {
71
- .nav-divider(@dropdownDividerTop, @dropdownDividerBottom);
59
+ .nav-divider(@dropdown-divider-bg);
72
60
  }
73
61
 
74
62
  // Links within the dropdown menu
@@ -77,81 +65,126 @@
77
65
  padding: 3px 20px;
78
66
  clear: both;
79
67
  font-weight: normal;
80
- line-height: @baseLineHeight;
81
- color: @dropdownLinkColor;
82
- white-space: nowrap;
68
+ line-height: @line-height-base;
69
+ color: @dropdown-link-color;
70
+ white-space: nowrap; // prevent links from randomly breaking onto new lines
83
71
  }
84
72
  }
85
73
 
86
74
  // Hover/Focus state
87
- // -----------
88
- .dropdown-menu > li > a:hover,
89
- .dropdown-menu > li > a:focus,
90
- .dropdown-submenu:hover > a,
91
- .dropdown-submenu:focus > a {
92
- text-decoration: none;
93
- color: @dropdownLinkColorHover;
94
- #gradient > .vertical(@dropdownLinkBackgroundHover, darken(@dropdownLinkBackgroundHover, 5%));
75
+ .dropdown-menu > li > a {
76
+ &:hover,
77
+ &:focus {
78
+ text-decoration: none;
79
+ color: @dropdown-link-hover-color;
80
+ background-color: @dropdown-link-hover-bg;
81
+ }
95
82
  }
96
83
 
97
84
  // Active state
98
- // ------------
99
- .dropdown-menu > .active > a,
100
- .dropdown-menu > .active > a:hover,
101
- .dropdown-menu > .active > a:focus {
102
- color: @dropdownLinkColorActive;
103
- text-decoration: none;
104
- outline: 0;
105
- #gradient > .vertical(@dropdownLinkBackgroundActive, darken(@dropdownLinkBackgroundActive, 5%));
85
+ .dropdown-menu > .active > a {
86
+ &,
87
+ &:hover,
88
+ &:focus {
89
+ color: @dropdown-link-active-color;
90
+ text-decoration: none;
91
+ outline: 0;
92
+ background-color: @dropdown-link-active-bg;
93
+ }
106
94
  }
107
95
 
108
96
  // Disabled state
109
- // --------------
97
+ //
110
98
  // Gray out text and ensure the hover/focus state remains gray
111
- .dropdown-menu > .disabled > a,
112
- .dropdown-menu > .disabled > a:hover,
113
- .dropdown-menu > .disabled > a:focus {
114
- color: @grayLight;
99
+
100
+ .dropdown-menu > .disabled > a {
101
+ &,
102
+ &:hover,
103
+ &:focus {
104
+ color: @dropdown-link-disabled-color;
105
+ }
115
106
  }
116
107
  // Nuke hover/focus effects
117
- .dropdown-menu > .disabled > a:hover,
118
- .dropdown-menu > .disabled > a:focus {
119
- text-decoration: none;
120
- background-color: transparent;
121
- background-image: none; // Remove CSS gradient
122
- .reset-filter();
123
- cursor: default;
108
+ .dropdown-menu > .disabled > a {
109
+ &:hover,
110
+ &:focus {
111
+ text-decoration: none;
112
+ background-color: transparent;
113
+ background-image: none; // Remove CSS gradient
114
+ .reset-filter();
115
+ cursor: not-allowed;
116
+ }
124
117
  }
125
118
 
126
119
  // Open state for the dropdown
127
- // ---------------------------
128
120
  .open {
129
- // IE7's z-index only goes to the nearest positioned ancestor, which would
130
- // make the menu appear below buttons that appeared later on the page
131
- *z-index: @zindexDropdown;
132
-
133
- & > .dropdown-menu {
121
+ // Show the menu
122
+ > .dropdown-menu {
134
123
  display: block;
135
124
  }
125
+
126
+ // Remove the outline when :focus is triggered
127
+ > a {
128
+ outline: 0;
129
+ }
130
+ }
131
+
132
+ // Menu positioning
133
+ //
134
+ // Add extra class to `.dropdown-menu` to flip the alignment of the dropdown
135
+ // menu with the parent.
136
+ .dropdown-menu-right {
137
+ left: auto; // Reset the default from `.dropdown-menu`
138
+ right: 0;
139
+ }
140
+ // With v3, we enabled auto-flipping if you have a dropdown within a right
141
+ // aligned nav component. To enable the undoing of that, we provide an override
142
+ // to restore the default dropdown menu alignment.
143
+ //
144
+ // This is only for left-aligning a dropdown menu within a `.navbar-right` or
145
+ // `.pull-right` nav component.
146
+ .dropdown-menu-left {
147
+ left: 0;
148
+ right: auto;
149
+ }
150
+
151
+ // Dropdown section headers
152
+ .dropdown-header {
153
+ display: block;
154
+ padding: 3px 20px;
155
+ font-size: @font-size-small;
156
+ line-height: @line-height-base;
157
+ color: @dropdown-header-color;
158
+ white-space: nowrap; // as with > li > a
159
+ }
160
+
161
+ // Backdrop to catch body clicks on mobile, etc.
162
+ .dropdown-backdrop {
163
+ position: fixed;
164
+ left: 0;
165
+ right: 0;
166
+ bottom: 0;
167
+ top: 0;
168
+ z-index: (@zindex-dropdown - 10);
136
169
  }
137
170
 
138
171
  // Right aligned dropdowns
139
- // ---------------------------
140
172
  .pull-right > .dropdown-menu {
141
173
  right: 0;
142
174
  left: auto;
143
175
  }
144
176
 
145
177
  // Allow for dropdowns to go bottom up (aka, dropup-menu)
146
- // ------------------------------------------------------
178
+ //
147
179
  // Just add .dropup after the standard .dropdown class and you're set, bro.
148
180
  // TODO: abstract this so that the navbar fixed styles are not placed here?
181
+
149
182
  .dropup,
150
183
  .navbar-fixed-bottom .dropdown {
151
184
  // Reverse the caret
152
185
  .caret {
153
186
  border-top: 0;
154
- border-bottom: 4px solid @black;
187
+ border-bottom: @caret-width-base solid;
155
188
  content: "";
156
189
  }
157
190
  // Different positioning for bottom up menu
@@ -162,76 +195,21 @@
162
195
  }
163
196
  }
164
197
 
165
- // Sub menus
166
- // ---------------------------
167
- .dropdown-submenu {
168
- position: relative;
169
- }
170
- // Default dropdowns
171
- .dropdown-submenu > .dropdown-menu {
172
- top: 0;
173
- left: 100%;
174
- margin-top: -6px;
175
- margin-left: -1px;
176
- .border-radius(0 6px 6px 6px);
177
- }
178
- .dropdown-submenu:hover > .dropdown-menu {
179
- display: block;
180
- }
181
-
182
- // Dropups
183
- .dropup .dropdown-submenu > .dropdown-menu {
184
- top: auto;
185
- bottom: 0;
186
- margin-top: 0;
187
- margin-bottom: -2px;
188
- .border-radius(5px 5px 5px 0);
189
- }
190
-
191
- // Caret to indicate there is a submenu
192
- .dropdown-submenu > a:after {
193
- display: block;
194
- content: " ";
195
- float: right;
196
- width: 0;
197
- height: 0;
198
- border-color: transparent;
199
- border-style: solid;
200
- border-width: 5px 0 5px 5px;
201
- border-left-color: darken(@dropdownBackground, 20%);
202
- margin-top: 5px;
203
- margin-right: -10px;
204
- }
205
- .dropdown-submenu:hover > a:after {
206
- border-left-color: @dropdownLinkColorHover;
207
- }
208
-
209
- // Left aligned submenus
210
- .dropdown-submenu.pull-left {
211
- // Undo the float
212
- // Yes, this is awkward since .pull-left adds a float, but it sticks to our conventions elsewhere.
213
- float: none;
214
198
 
215
- // Positioning the submenu
216
- > .dropdown-menu {
217
- left: -100%;
218
- margin-left: 10px;
219
- .border-radius(6px 0 6px 6px);
199
+ // Component alignment
200
+ //
201
+ // Reiterate per navbar.less and the modified component alignment there.
202
+
203
+ @media (min-width: @grid-float-breakpoint) {
204
+ .navbar-right {
205
+ .dropdown-menu {
206
+ .dropdown-menu-right();
207
+ }
208
+ // Necessary for overrides of the default right aligned menu.
209
+ // Will remove come v4 in all likelihood.
210
+ .dropdown-menu-left {
211
+ .dropdown-menu-left();
212
+ }
220
213
  }
221
214
  }
222
215
 
223
- // Tweak nav headers
224
- // -----------------
225
- // Increase padding from 15px to 20px on sides
226
- .dropdown .dropdown-menu .nav-header {
227
- padding-left: 20px;
228
- padding-right: 20px;
229
- }
230
-
231
- // Typeahead
232
- // ---------
233
- .typeahead {
234
- z-index: 1051;
235
- margin-top: 2px; // give it some space to breathe
236
- .border-radius(@baseBorderRadius);
237
- }