twitter-bootstrap-rails 2.2.8 → 4.0.0

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 (185) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +229 -322
  3. data/Rakefile +4 -6
  4. data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  5. data/app/assets/fonts/glyphicons-halflings-regular.svg +288 -0
  6. data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  7. data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  8. data/app/assets/fonts/glyphicons-halflings-regular.woff2 +0 -0
  9. data/app/assets/javascripts/twitter/bootstrap.js +12 -13
  10. data/app/assets/javascripts/twitter/bootstrap/affix.js +162 -0
  11. data/app/assets/javascripts/twitter/bootstrap/alert.js +94 -0
  12. data/app/assets/javascripts/twitter/bootstrap/button.js +120 -0
  13. data/app/assets/javascripts/twitter/bootstrap/carousel.js +237 -0
  14. data/app/assets/javascripts/twitter/bootstrap/collapse.js +211 -0
  15. data/app/assets/javascripts/twitter/bootstrap/dropdown.js +165 -0
  16. data/app/assets/javascripts/twitter/bootstrap/modal.js +337 -0
  17. data/app/assets/javascripts/twitter/bootstrap/popover.js +108 -0
  18. data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +172 -0
  19. data/app/assets/javascripts/twitter/bootstrap/tab.js +155 -0
  20. data/app/assets/javascripts/twitter/bootstrap/tooltip.js +514 -0
  21. data/app/assets/javascripts/twitter/bootstrap/transition.js +59 -0
  22. data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +1 -890
  23. data/app/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +1 -146
  24. data/app/helpers/bootstrap_flash_helper.rb +14 -7
  25. data/app/helpers/form_errors_helper.rb +22 -0
  26. data/app/helpers/glyph_helper.rb +12 -6
  27. data/app/helpers/modal_helper.rb +26 -22
  28. data/app/helpers/navbar_helper.rb +47 -32
  29. data/app/helpers/twitter_breadcrumbs_helper.rb +6 -2
  30. data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +8 -8
  31. data/lib/generators/bootstrap/install/install_generator.rb +3 -2
  32. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.css +3 -4
  33. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +9 -18
  34. data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +5 -0
  35. data/lib/generators/bootstrap/layout/layout_generator.rb +1 -4
  36. data/lib/generators/bootstrap/layout/templates/layout.html.erb +27 -48
  37. data/lib/generators/bootstrap/layout/templates/layout.html.haml +19 -34
  38. data/lib/generators/bootstrap/layout/templates/layout.html.slim +13 -30
  39. data/lib/generators/bootstrap/partial/templates/_login.html.erb +2 -3
  40. data/lib/generators/bootstrap/themed/templates/_form.html.erb +30 -10
  41. data/lib/generators/bootstrap/themed/templates/_form.html.haml +10 -8
  42. data/lib/generators/bootstrap/themed/templates/_form.html.slim +11 -9
  43. data/lib/generators/bootstrap/themed/templates/edit.html.slim +1 -1
  44. data/lib/generators/bootstrap/themed/templates/index.html.erb +4 -2
  45. data/lib/generators/bootstrap/themed/templates/index.html.haml +3 -2
  46. data/lib/generators/bootstrap/themed/templates/index.html.slim +6 -5
  47. data/lib/generators/bootstrap/themed/templates/new.html.slim +1 -1
  48. data/lib/generators/bootstrap/themed/templates/show.html.erb +5 -7
  49. data/lib/generators/bootstrap/themed/templates/show.html.haml +4 -4
  50. data/lib/generators/bootstrap/themed/templates/show.html.slim +6 -7
  51. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +5 -5
  52. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +3 -3
  53. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +4 -4
  54. data/lib/generators/bootstrap/themed/themed_generator.rb +2 -2
  55. data/lib/twitter/bootstrap/rails/breadcrumbs.rb +69 -0
  56. data/lib/twitter/bootstrap/rails/engine.rb +17 -10
  57. data/lib/twitter/bootstrap/rails/version.rb +2 -2
  58. data/spec/lib/breadcrumbs_spec.rb +99 -0
  59. data/spec/lib/twitter_bootstrap_rails/badge_label_helper_spec.rb +12 -4
  60. data/spec/lib/twitter_bootstrap_rails/bootstrap_flash_helper_spec.rb +128 -0
  61. data/spec/lib/twitter_bootstrap_rails/form_errors_helper_spec.rb +148 -0
  62. data/spec/lib/twitter_bootstrap_rails/glyph_helper_spec.rb +24 -0
  63. data/spec/lib/twitter_bootstrap_rails/modal_helper_spec.rb +15 -15
  64. data/spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb +207 -173
  65. data/spec/lib/twitter_bootstrap_rails/uri_state_spec.rb +18 -16
  66. data/spec/spec_helper.rb +11 -1
  67. data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +5796 -1
  68. data/vendor/static-source/bootstrap.less +0 -1
  69. data/vendor/static-source/sprites.less +1 -1
  70. data/vendor/toolkit/twitter/bootstrap/alerts.less +51 -57
  71. data/vendor/toolkit/twitter/bootstrap/badges.less +66 -0
  72. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +29 -36
  73. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +11 -9
  74. data/vendor/toolkit/twitter/bootstrap/button-groups.less +167 -152
  75. data/vendor/toolkit/twitter/bootstrap/buttons.less +107 -169
  76. data/vendor/toolkit/twitter/bootstrap/carousel.less +177 -65
  77. data/vendor/toolkit/twitter/bootstrap/close.less +21 -19
  78. data/vendor/toolkit/twitter/bootstrap/code.less +38 -30
  79. data/vendor/toolkit/twitter/bootstrap/component-animations.less +15 -4
  80. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +120 -152
  81. data/vendor/toolkit/twitter/bootstrap/forms.less +470 -547
  82. data/vendor/toolkit/twitter/bootstrap/glyphicons.less +305 -0
  83. data/vendor/toolkit/twitter/bootstrap/grid.less +74 -11
  84. data/vendor/toolkit/twitter/bootstrap/input-groups.less +171 -0
  85. data/vendor/toolkit/twitter/bootstrap/jumbotron.less +54 -0
  86. data/vendor/toolkit/twitter/bootstrap/labels.less +64 -0
  87. data/vendor/toolkit/twitter/bootstrap/list-group.less +130 -0
  88. data/vendor/toolkit/twitter/bootstrap/media.less +40 -29
  89. data/vendor/toolkit/twitter/bootstrap/mixins.less +37 -699
  90. data/vendor/toolkit/twitter/bootstrap/mixins/alerts.less +14 -0
  91. data/vendor/toolkit/twitter/bootstrap/mixins/background-variant.less +9 -0
  92. data/vendor/toolkit/twitter/bootstrap/mixins/border-radius.less +18 -0
  93. data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +65 -0
  94. data/vendor/toolkit/twitter/bootstrap/mixins/center-block.less +7 -0
  95. data/vendor/toolkit/twitter/bootstrap/mixins/clearfix.less +22 -0
  96. data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +85 -0
  97. data/vendor/toolkit/twitter/bootstrap/mixins/gradients.less +59 -0
  98. data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +91 -0
  99. data/vendor/toolkit/twitter/bootstrap/mixins/grid.less +122 -0
  100. data/vendor/toolkit/twitter/bootstrap/mixins/hide-text.less +21 -0
  101. data/vendor/toolkit/twitter/bootstrap/mixins/image.less +33 -0
  102. data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +12 -0
  103. data/vendor/toolkit/twitter/bootstrap/mixins/list-group.less +30 -0
  104. data/vendor/toolkit/twitter/bootstrap/mixins/nav-divider.less +10 -0
  105. data/vendor/toolkit/twitter/bootstrap/mixins/nav-vertical-align.less +9 -0
  106. data/vendor/toolkit/twitter/bootstrap/mixins/opacity.less +8 -0
  107. data/vendor/toolkit/twitter/bootstrap/mixins/pagination.less +24 -0
  108. data/vendor/toolkit/twitter/bootstrap/mixins/panels.less +24 -0
  109. data/vendor/toolkit/twitter/bootstrap/mixins/progress-bar.less +10 -0
  110. data/vendor/toolkit/twitter/bootstrap/mixins/reset-filter.less +8 -0
  111. data/vendor/toolkit/twitter/bootstrap/mixins/reset-text.less +18 -0
  112. data/vendor/toolkit/twitter/bootstrap/mixins/resize.less +6 -0
  113. data/vendor/toolkit/twitter/bootstrap/mixins/responsive-visibility.less +15 -0
  114. data/vendor/toolkit/twitter/bootstrap/mixins/size.less +10 -0
  115. data/vendor/toolkit/twitter/bootstrap/mixins/tab-focus.less +9 -0
  116. data/vendor/toolkit/twitter/bootstrap/mixins/table-row.less +28 -0
  117. data/vendor/toolkit/twitter/bootstrap/mixins/text-emphasis.less +9 -0
  118. data/vendor/toolkit/twitter/bootstrap/mixins/text-overflow.less +8 -0
  119. data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +227 -0
  120. data/vendor/toolkit/twitter/bootstrap/modals.less +109 -54
  121. data/vendor/toolkit/twitter/bootstrap/navbar.less +547 -384
  122. data/vendor/toolkit/twitter/bootstrap/navs.less +192 -359
  123. data/vendor/toolkit/twitter/bootstrap/normalize.less +424 -0
  124. data/vendor/toolkit/twitter/bootstrap/pager.less +45 -34
  125. data/vendor/toolkit/twitter/bootstrap/pagination.less +71 -105
  126. data/vendor/toolkit/twitter/bootstrap/panels.less +271 -0
  127. data/vendor/toolkit/twitter/bootstrap/popovers.less +66 -68
  128. data/vendor/toolkit/twitter/bootstrap/print.less +101 -0
  129. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +40 -75
  130. data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +35 -0
  131. data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +177 -42
  132. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +131 -23
  133. data/vendor/toolkit/twitter/bootstrap/tables.less +172 -182
  134. data/vendor/toolkit/twitter/bootstrap/theme.less +291 -0
  135. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +27 -44
  136. data/vendor/toolkit/twitter/bootstrap/tooltip.less +58 -27
  137. data/vendor/toolkit/twitter/bootstrap/type.less +209 -154
  138. data/vendor/toolkit/twitter/bootstrap/utilities.less +32 -7
  139. data/vendor/toolkit/twitter/bootstrap/variables.less +784 -216
  140. data/vendor/toolkit/twitter/bootstrap/wells.less +7 -7
  141. metadata +156 -141
  142. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  143. data/app/assets/fonts/fontawesome-webfont.svg +0 -399
  144. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  145. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  146. data/app/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  147. data/app/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  148. data/app/assets/javascripts/twitter/bootstrap/bootstrap-affix.js +0 -117
  149. data/app/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +0 -99
  150. data/app/assets/javascripts/twitter/bootstrap/bootstrap-button.js +0 -105
  151. data/app/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +0 -207
  152. data/app/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +0 -167
  153. data/app/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +0 -169
  154. data/app/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +0 -247
  155. data/app/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +0 -114
  156. data/app/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +0 -162
  157. data/app/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +0 -144
  158. data/app/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +0 -361
  159. data/app/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +0 -60
  160. data/app/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +0 -335
  161. data/app/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +0 -787
  162. data/lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb +0 -42
  163. data/test/lib/breadcrumbs_test.rb +0 -75
  164. data/test/test_helper.rb +0 -11
  165. data/vendor/static-source/fontawesome.less +0 -9
  166. data/vendor/toolkit/fontawesome/bootstrap.less +0 -84
  167. data/vendor/toolkit/fontawesome/core.less +0 -129
  168. data/vendor/toolkit/fontawesome/extras.less +0 -93
  169. data/vendor/toolkit/fontawesome/font-awesome-ie7.less +0 -1953
  170. data/vendor/toolkit/fontawesome/font-awesome.less +0 -33
  171. data/vendor/toolkit/fontawesome/icons.less +0 -381
  172. data/vendor/toolkit/fontawesome/mixins.less +0 -48
  173. data/vendor/toolkit/fontawesome/path.less +0 -14
  174. data/vendor/toolkit/fontawesome/variables.less +0 -735
  175. data/vendor/toolkit/twitter/bootstrap/accordion.less +0 -34
  176. data/vendor/toolkit/twitter/bootstrap/hero-unit.less +0 -25
  177. data/vendor/toolkit/twitter/bootstrap/labels-badges.less +0 -84
  178. data/vendor/toolkit/twitter/bootstrap/layouts.less +0 -16
  179. data/vendor/toolkit/twitter/bootstrap/reset.less +0 -216
  180. data/vendor/toolkit/twitter/bootstrap/responsive-1200px-min.less +0 -28
  181. data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +0 -193
  182. data/vendor/toolkit/twitter/bootstrap/responsive-768px-979px.less +0 -19
  183. data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +0 -189
  184. data/vendor/toolkit/twitter/bootstrap/responsive.less +0 -48
  185. data/vendor/toolkit/twitter/bootstrap/sprites.less +0 -197
@@ -5,28 +5,30 @@
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
+ // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
27
+ button& {
28
+ padding: 0;
29
+ cursor: pointer;
30
+ background: transparent;
31
+ border: 0;
32
+ -webkit-appearance: none;
33
+ }
34
+ }
@@ -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,18 @@
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
- .transition(height .35s ease);
19
- &.in {
20
- height: auto;
21
- }
30
+ .transition-property(~"height, visibility");
31
+ .transition-duration(.35s);
32
+ .transition-timing-function(ease);
22
33
  }
@@ -3,64 +3,54 @@
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 dashed;
14
+ border-top: @caret-width-base solid ~"\9"; // IE8
15
+ border-right: @caret-width-base solid transparent;
16
+ border-left: @caret-width-base solid transparent;
31
17
  }
32
18
 
33
- // Place the caret
34
- .dropdown .caret {
35
- margin-top: 8px;
36
- margin-left: 2px;
19
+ // The dropdown wrapper (div)
20
+ .dropup,
21
+ .dropdown {
22
+ position: relative;
23
+ }
24
+
25
+ // Prevent the focus on the dropdown toggle when closing dropdowns
26
+ .dropdown-toggle:focus {
27
+ outline: 0;
37
28
  }
38
29
 
39
30
  // The dropdown menu (ul)
40
- // ----------------------
41
31
  .dropdown-menu {
42
32
  position: absolute;
43
33
  top: 100%;
44
34
  left: 0;
45
- z-index: @zindexDropdown;
35
+ z-index: @zindex-dropdown;
46
36
  display: none; // none by default, but block on "open" of the menu
47
37
  float: left;
48
38
  min-width: 160px;
49
39
  padding: 5px 0;
50
40
  margin: 2px 0 0; // override default ul
51
41
  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;
42
+ font-size: @font-size-base;
43
+ text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
44
+ background-color: @dropdown-bg;
45
+ border: 1px solid @dropdown-fallback-border; // IE8 fallback
46
+ border: 1px solid @dropdown-border;
47
+ border-radius: @border-radius-base;
48
+ .box-shadow(0 6px 12px rgba(0,0,0,.175));
49
+ background-clip: padding-box;
62
50
 
63
51
  // Aligns the dropdown menu to right
52
+ //
53
+ // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]`
64
54
  &.pull-right {
65
55
  right: 0;
66
56
  left: auto;
@@ -68,7 +58,7 @@
68
58
 
69
59
  // Dividers (basically an hr) within the dropdown
70
60
  .divider {
71
- .nav-divider(@dropdownDividerTop, @dropdownDividerBottom);
61
+ .nav-divider(@dropdown-divider-bg);
72
62
  }
73
63
 
74
64
  // Links within the dropdown menu
@@ -77,172 +67,150 @@
77
67
  padding: 3px 20px;
78
68
  clear: both;
79
69
  font-weight: normal;
80
- line-height: @baseLineHeight;
81
- color: @dropdownLinkColor;
82
- white-space: nowrap;
70
+ line-height: @line-height-base;
71
+ color: @dropdown-link-color;
72
+ white-space: nowrap; // prevent links from randomly breaking onto new lines
83
73
  }
84
74
  }
85
75
 
86
76
  // 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%));
77
+ .dropdown-menu > li > a {
78
+ &:hover,
79
+ &:focus {
80
+ text-decoration: none;
81
+ color: @dropdown-link-hover-color;
82
+ background-color: @dropdown-link-hover-bg;
83
+ }
95
84
  }
96
85
 
97
86
  // 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%));
87
+ .dropdown-menu > .active > a {
88
+ &,
89
+ &:hover,
90
+ &:focus {
91
+ color: @dropdown-link-active-color;
92
+ text-decoration: none;
93
+ outline: 0;
94
+ background-color: @dropdown-link-active-bg;
95
+ }
106
96
  }
107
97
 
108
98
  // Disabled state
109
- // --------------
99
+ //
110
100
  // 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;
115
- }
116
- // 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;
101
+
102
+ .dropdown-menu > .disabled > a {
103
+ &,
104
+ &:hover,
105
+ &:focus {
106
+ color: @dropdown-link-disabled-color;
107
+ }
108
+
109
+ // Nuke hover/focus effects
110
+ &:hover,
111
+ &:focus {
112
+ text-decoration: none;
113
+ background-color: transparent;
114
+ background-image: none; // Remove CSS gradient
115
+ .reset-filter();
116
+ cursor: @cursor-disabled;
117
+ }
124
118
  }
125
119
 
126
120
  // Open state for the dropdown
127
- // ---------------------------
128
121
  .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 {
122
+ // Show the menu
123
+ > .dropdown-menu {
134
124
  display: block;
135
125
  }
126
+
127
+ // Remove the outline when :focus is triggered
128
+ > a {
129
+ outline: 0;
130
+ }
131
+ }
132
+
133
+ // Menu positioning
134
+ //
135
+ // Add extra class to `.dropdown-menu` to flip the alignment of the dropdown
136
+ // menu with the parent.
137
+ .dropdown-menu-right {
138
+ left: auto; // Reset the default from `.dropdown-menu`
139
+ right: 0;
140
+ }
141
+ // With v3, we enabled auto-flipping if you have a dropdown within a right
142
+ // aligned nav component. To enable the undoing of that, we provide an override
143
+ // to restore the default dropdown menu alignment.
144
+ //
145
+ // This is only for left-aligning a dropdown menu within a `.navbar-right` or
146
+ // `.pull-right` nav component.
147
+ .dropdown-menu-left {
148
+ left: 0;
149
+ right: auto;
150
+ }
151
+
152
+ // Dropdown section headers
153
+ .dropdown-header {
154
+ display: block;
155
+ padding: 3px 20px;
156
+ font-size: @font-size-small;
157
+ line-height: @line-height-base;
158
+ color: @dropdown-header-color;
159
+ white-space: nowrap; // as with > li > a
136
160
  }
137
161
 
138
162
  // Backdrop to catch body clicks on mobile, etc.
139
- // ---------------------------
140
163
  .dropdown-backdrop {
141
164
  position: fixed;
142
165
  left: 0;
143
166
  right: 0;
144
167
  bottom: 0;
145
168
  top: 0;
146
- z-index: @zindexDropdown - 10;
169
+ z-index: (@zindex-dropdown - 10);
147
170
  }
148
171
 
149
172
  // Right aligned dropdowns
150
- // ---------------------------
151
173
  .pull-right > .dropdown-menu {
152
174
  right: 0;
153
175
  left: auto;
154
176
  }
155
177
 
156
178
  // Allow for dropdowns to go bottom up (aka, dropup-menu)
157
- // ------------------------------------------------------
179
+ //
158
180
  // Just add .dropup after the standard .dropdown class and you're set, bro.
159
181
  // TODO: abstract this so that the navbar fixed styles are not placed here?
182
+
160
183
  .dropup,
161
184
  .navbar-fixed-bottom .dropdown {
162
185
  // Reverse the caret
163
186
  .caret {
164
187
  border-top: 0;
165
- border-bottom: 4px solid @black;
188
+ border-bottom: @caret-width-base dashed;
189
+ border-bottom: @caret-width-base solid ~"\9"; // IE8
166
190
  content: "";
167
191
  }
168
192
  // Different positioning for bottom up menu
169
193
  .dropdown-menu {
170
194
  top: auto;
171
195
  bottom: 100%;
172
- margin-bottom: 1px;
196
+ margin-bottom: 2px;
173
197
  }
174
198
  }
175
199
 
176
- // Sub menus
177
- // ---------------------------
178
- .dropdown-submenu {
179
- position: relative;
180
- }
181
- // Default dropdowns
182
- .dropdown-submenu > .dropdown-menu {
183
- top: 0;
184
- left: 100%;
185
- margin-top: -6px;
186
- margin-left: -1px;
187
- .border-radius(0 6px 6px 6px);
188
- }
189
- .dropdown-submenu:hover > .dropdown-menu {
190
- display: block;
191
- }
192
200
 
193
- // Dropups
194
- .dropup .dropdown-submenu > .dropdown-menu {
195
- top: auto;
196
- bottom: 0;
197
- margin-top: 0;
198
- margin-bottom: -2px;
199
- .border-radius(5px 5px 5px 0);
200
- }
201
-
202
- // Caret to indicate there is a submenu
203
- .dropdown-submenu > a:after {
204
- display: block;
205
- content: " ";
206
- float: right;
207
- width: 0;
208
- height: 0;
209
- border-color: transparent;
210
- border-style: solid;
211
- border-width: 5px 0 5px 5px;
212
- border-left-color: darken(@dropdownBackground, 20%);
213
- margin-top: 5px;
214
- margin-right: -10px;
215
- }
216
- .dropdown-submenu:hover > a:after {
217
- border-left-color: @dropdownLinkColorHover;
218
- }
219
-
220
- // Left aligned submenus
221
- .dropdown-submenu.pull-left {
222
- // Undo the float
223
- // Yes, this is awkward since .pull-left adds a float, but it sticks to our conventions elsewhere.
224
- float: none;
225
-
226
- // Positioning the submenu
227
- > .dropdown-menu {
228
- left: -100%;
229
- margin-left: 10px;
230
- .border-radius(6px 0 6px 6px);
201
+ // Component alignment
202
+ //
203
+ // Reiterate per navbar.less and the modified component alignment there.
204
+
205
+ @media (min-width: @grid-float-breakpoint) {
206
+ .navbar-right {
207
+ .dropdown-menu {
208
+ .dropdown-menu-right();
209
+ }
210
+ // Necessary for overrides of the default right aligned menu.
211
+ // Will remove come v4 in all likelihood.
212
+ .dropdown-menu-left {
213
+ .dropdown-menu-left();
214
+ }
231
215
  }
232
216
  }
233
-
234
- // Tweak nav headers
235
- // -----------------
236
- // Increase padding from 15px to 20px on sides
237
- .dropdown .dropdown-menu .nav-header {
238
- padding-left: 20px;
239
- padding-right: 20px;
240
- }
241
-
242
- // Typeahead
243
- // ---------
244
- .typeahead {
245
- z-index: 1051;
246
- margin-top: 2px; // give it some space to breathe
247
- .border-radius(@baseBorderRadius);
248
- }