twitter-bootstrap-rails 2.2.8 → 3.2.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 (181) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +82 -119
  3. data/Rakefile +4 -6
  4. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  5. data/app/assets/fonts/fontawesome-webfont.svg +471 -366
  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 -13
  13. data/app/assets/javascripts/twitter/bootstrap/affix.js +137 -0
  14. data/app/assets/javascripts/twitter/bootstrap/alert.js +88 -0
  15. data/app/assets/javascripts/twitter/bootstrap/button.js +107 -0
  16. data/app/assets/javascripts/twitter/bootstrap/carousel.js +205 -0
  17. data/app/assets/javascripts/twitter/bootstrap/collapse.js +170 -0
  18. data/app/assets/javascripts/twitter/bootstrap/dropdown.js +147 -0
  19. data/app/assets/javascripts/twitter/bootstrap/modal.js +243 -0
  20. data/app/assets/javascripts/twitter/bootstrap/popover.js +110 -0
  21. data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +153 -0
  22. data/app/assets/javascripts/twitter/bootstrap/tab.js +125 -0
  23. data/app/assets/javascripts/twitter/bootstrap/tooltip.js +399 -0
  24. data/app/assets/javascripts/twitter/bootstrap/transition.js +48 -0
  25. data/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +1 -890
  26. data/app/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +4 -787
  27. data/app/assets/stylesheets/twitter-bootstrap-static/sprites.css.erb +1 -146
  28. data/app/helpers/bootstrap_flash_helper.rb +7 -5
  29. data/app/helpers/form_errors_helper.rb +22 -0
  30. data/app/helpers/glyph_helper.rb +8 -6
  31. data/app/helpers/modal_helper.rb +29 -21
  32. data/app/helpers/navbar_helper.rb +42 -30
  33. data/app/helpers/twitter_breadcrumbs_helper.rb +3 -2
  34. data/app/views/twitter-bootstrap/_breadcrumbs.html.erb +4 -4
  35. data/lib/generators/bootstrap/install/install_generator.rb +3 -2
  36. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +7 -8
  37. data/lib/generators/bootstrap/install/templates/en.bootstrap.yml +5 -0
  38. data/lib/generators/bootstrap/layout/layout_generator.rb +1 -4
  39. data/lib/generators/bootstrap/layout/templates/layout.html.erb +22 -43
  40. data/lib/generators/bootstrap/layout/templates/layout.html.haml +16 -31
  41. data/lib/generators/bootstrap/layout/templates/layout.html.slim +10 -25
  42. data/lib/generators/bootstrap/partial/templates/_login.html.erb +2 -3
  43. data/lib/generators/bootstrap/themed/templates/_form.html.erb +25 -8
  44. data/lib/generators/bootstrap/themed/templates/_form.html.haml +7 -7
  45. data/lib/generators/bootstrap/themed/templates/_form.html.slim +7 -7
  46. data/lib/generators/bootstrap/themed/templates/index.html.erb +2 -2
  47. data/lib/generators/bootstrap/themed/templates/index.html.haml +2 -2
  48. data/lib/generators/bootstrap/themed/templates/index.html.slim +2 -2
  49. data/lib/generators/bootstrap/themed/templates/show.html.erb +5 -7
  50. data/lib/generators/bootstrap/themed/templates/show.html.haml +4 -4
  51. data/lib/generators/bootstrap/themed/templates/show.html.slim +5 -6
  52. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +5 -5
  53. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +3 -3
  54. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +4 -4
  55. data/lib/generators/bootstrap/themed/themed_generator.rb +2 -2
  56. data/lib/twitter/bootstrap/rails/{twitter-bootstrap-breadcrumbs.rb → breadcrumbs.rb} +24 -8
  57. data/lib/twitter/bootstrap/rails/engine.rb +5 -2
  58. data/lib/twitter/bootstrap/rails/version.rb +2 -2
  59. data/spec/lib/breadcrumbs_spec.rb +74 -0
  60. data/spec/lib/twitter_bootstrap_rails/badge_label_helper_spec.rb +4 -2
  61. data/spec/lib/twitter_bootstrap_rails/modal_helper_spec.rb +15 -15
  62. data/spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb +157 -173
  63. data/spec/lib/twitter_bootstrap_rails/uri_state_spec.rb +18 -16
  64. data/spec/spec_helper.rb +7 -1
  65. data/vendor/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb +5797 -0
  66. data/vendor/static-source/bootstrap.less +0 -1
  67. data/vendor/static-source/fontawesome.less +0 -1
  68. data/vendor/static-source/sprites.less +1 -1
  69. data/vendor/toolkit/fontawesome/bordered-pulled.less +16 -0
  70. data/vendor/toolkit/fontawesome/core.less +9 -126
  71. data/vendor/toolkit/fontawesome/fixed-width.less +6 -0
  72. data/vendor/toolkit/fontawesome/font-awesome.less +9 -25
  73. data/vendor/toolkit/fontawesome/icons.less +503 -378
  74. data/vendor/toolkit/fontawesome/larger.less +13 -0
  75. data/vendor/toolkit/fontawesome/list.less +19 -0
  76. data/vendor/toolkit/fontawesome/mixins.less +14 -42
  77. data/vendor/toolkit/fontawesome/path.less +1 -1
  78. data/vendor/toolkit/fontawesome/rotated-flipped.less +9 -0
  79. data/vendor/toolkit/fontawesome/spinning.less +32 -0
  80. data/vendor/toolkit/fontawesome/stacked.less +20 -0
  81. data/vendor/toolkit/fontawesome/variables.less +511 -731
  82. data/vendor/toolkit/twitter/bootstrap/alerts.less +47 -58
  83. data/vendor/toolkit/twitter/bootstrap/badges.less +55 -0
  84. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +27 -39
  85. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +11 -9
  86. data/vendor/toolkit/twitter/bootstrap/button-groups.less +168 -152
  87. data/vendor/toolkit/twitter/bootstrap/buttons.less +101 -170
  88. data/vendor/toolkit/twitter/bootstrap/carousel.less +150 -65
  89. data/vendor/toolkit/twitter/bootstrap/close.less +20 -19
  90. data/vendor/toolkit/twitter/bootstrap/code.less +38 -30
  91. data/vendor/toolkit/twitter/bootstrap/component-animations.less +12 -3
  92. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +115 -148
  93. data/vendor/toolkit/twitter/bootstrap/forms.less +401 -547
  94. data/vendor/toolkit/twitter/bootstrap/glyphicons.less +233 -0
  95. data/vendor/toolkit/twitter/bootstrap/grid.less +74 -11
  96. data/vendor/toolkit/twitter/bootstrap/input-groups.less +166 -0
  97. data/vendor/toolkit/twitter/bootstrap/jumbotron.less +48 -0
  98. data/vendor/toolkit/twitter/bootstrap/labels.less +64 -0
  99. data/vendor/toolkit/twitter/bootstrap/list-group.less +132 -0
  100. data/vendor/toolkit/twitter/bootstrap/media.less +8 -7
  101. data/vendor/toolkit/twitter/bootstrap/mixins.less +36 -699
  102. data/vendor/toolkit/twitter/bootstrap/mixins/alerts.less +14 -0
  103. data/vendor/toolkit/twitter/bootstrap/mixins/background-variant.less +8 -0
  104. data/vendor/toolkit/twitter/bootstrap/mixins/border-radius.less +18 -0
  105. data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +52 -0
  106. data/vendor/toolkit/twitter/bootstrap/mixins/center-block.less +7 -0
  107. data/vendor/toolkit/twitter/bootstrap/mixins/clearfix.less +22 -0
  108. data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +85 -0
  109. data/vendor/toolkit/twitter/bootstrap/mixins/gradients.less +59 -0
  110. data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +91 -0
  111. data/vendor/toolkit/twitter/bootstrap/mixins/grid.less +122 -0
  112. data/vendor/toolkit/twitter/bootstrap/mixins/hide-text.less +21 -0
  113. data/vendor/toolkit/twitter/bootstrap/mixins/image.less +33 -0
  114. data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +12 -0
  115. data/vendor/toolkit/twitter/bootstrap/mixins/list-group.less +29 -0
  116. data/vendor/toolkit/twitter/bootstrap/mixins/nav-divider.less +10 -0
  117. data/vendor/toolkit/twitter/bootstrap/mixins/nav-vertical-align.less +9 -0
  118. data/vendor/toolkit/twitter/bootstrap/mixins/opacity.less +8 -0
  119. data/vendor/toolkit/twitter/bootstrap/mixins/pagination.less +23 -0
  120. data/vendor/toolkit/twitter/bootstrap/mixins/panels.less +24 -0
  121. data/vendor/toolkit/twitter/bootstrap/mixins/progress-bar.less +10 -0
  122. data/vendor/toolkit/twitter/bootstrap/mixins/reset-filter.less +8 -0
  123. data/vendor/toolkit/twitter/bootstrap/mixins/resize.less +6 -0
  124. data/vendor/toolkit/twitter/bootstrap/mixins/responsive-visibility.less +15 -0
  125. data/vendor/toolkit/twitter/bootstrap/mixins/size.less +10 -0
  126. data/vendor/toolkit/twitter/bootstrap/mixins/tab-focus.less +9 -0
  127. data/vendor/toolkit/twitter/bootstrap/mixins/table-row.less +28 -0
  128. data/vendor/toolkit/twitter/bootstrap/mixins/text-emphasis.less +8 -0
  129. data/vendor/toolkit/twitter/bootstrap/mixins/text-overflow.less +8 -0
  130. data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +224 -0
  131. data/vendor/toolkit/twitter/bootstrap/modals.less +109 -54
  132. data/vendor/toolkit/twitter/bootstrap/navbar.less +542 -384
  133. data/vendor/toolkit/twitter/bootstrap/navs.less +192 -359
  134. data/vendor/toolkit/twitter/bootstrap/normalize.less +425 -0
  135. data/vendor/toolkit/twitter/bootstrap/pager.less +46 -34
  136. data/vendor/toolkit/twitter/bootstrap/pagination.less +70 -105
  137. data/vendor/toolkit/twitter/bootstrap/panels.less +248 -0
  138. data/vendor/toolkit/twitter/bootstrap/popovers.less +61 -61
  139. data/vendor/toolkit/twitter/bootstrap/print.less +101 -0
  140. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +51 -73
  141. data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +34 -0
  142. data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +177 -42
  143. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +120 -23
  144. data/vendor/toolkit/twitter/bootstrap/tables.less +171 -182
  145. data/vendor/toolkit/twitter/bootstrap/theme.less +260 -0
  146. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +26 -43
  147. data/vendor/toolkit/twitter/bootstrap/tooltip.less +49 -24
  148. data/vendor/toolkit/twitter/bootstrap/type.less +208 -147
  149. data/vendor/toolkit/twitter/bootstrap/utilities.less +33 -7
  150. data/vendor/toolkit/twitter/bootstrap/variables.less +761 -215
  151. data/vendor/toolkit/twitter/bootstrap/wells.less +7 -7
  152. metadata +128 -138
  153. data/app/assets/javascripts/twitter/bootstrap/bootstrap-affix.js +0 -117
  154. data/app/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +0 -99
  155. data/app/assets/javascripts/twitter/bootstrap/bootstrap-button.js +0 -105
  156. data/app/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +0 -207
  157. data/app/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +0 -167
  158. data/app/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +0 -169
  159. data/app/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +0 -247
  160. data/app/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +0 -114
  161. data/app/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +0 -162
  162. data/app/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +0 -144
  163. data/app/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +0 -361
  164. data/app/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +0 -60
  165. data/app/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +0 -335
  166. data/test/lib/breadcrumbs_test.rb +0 -75
  167. data/test/test_helper.rb +0 -11
  168. data/vendor/toolkit/fontawesome/bootstrap.less +0 -84
  169. data/vendor/toolkit/fontawesome/extras.less +0 -93
  170. data/vendor/toolkit/fontawesome/font-awesome-ie7.less +0 -1953
  171. data/vendor/toolkit/twitter/bootstrap/accordion.less +0 -34
  172. data/vendor/toolkit/twitter/bootstrap/hero-unit.less +0 -25
  173. data/vendor/toolkit/twitter/bootstrap/labels-badges.less +0 -84
  174. data/vendor/toolkit/twitter/bootstrap/layouts.less +0 -16
  175. data/vendor/toolkit/twitter/bootstrap/reset.less +0 -216
  176. data/vendor/toolkit/twitter/bootstrap/responsive-1200px-min.less +0 -28
  177. data/vendor/toolkit/twitter/bootstrap/responsive-767px-max.less +0 -193
  178. data/vendor/toolkit/twitter/bootstrap/responsive-768px-979px.less +0 -19
  179. data/vendor/toolkit/twitter/bootstrap/responsive-navbar.less +0 -189
  180. data/vendor/toolkit/twitter/bootstrap/responsive.less +0 -48
  181. 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,92 +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
136
159
  }
137
160
 
138
161
  // Backdrop to catch body clicks on mobile, etc.
139
- // ---------------------------
140
162
  .dropdown-backdrop {
141
163
  position: fixed;
142
164
  left: 0;
143
165
  right: 0;
144
166
  bottom: 0;
145
167
  top: 0;
146
- z-index: @zindexDropdown - 10;
168
+ z-index: (@zindex-dropdown - 10);
147
169
  }
148
170
 
149
171
  // Right aligned dropdowns
150
- // ---------------------------
151
172
  .pull-right > .dropdown-menu {
152
173
  right: 0;
153
174
  left: auto;
154
175
  }
155
176
 
156
177
  // Allow for dropdowns to go bottom up (aka, dropup-menu)
157
- // ------------------------------------------------------
178
+ //
158
179
  // Just add .dropup after the standard .dropdown class and you're set, bro.
159
180
  // TODO: abstract this so that the navbar fixed styles are not placed here?
181
+
160
182
  .dropup,
161
183
  .navbar-fixed-bottom .dropdown {
162
184
  // Reverse the caret
163
185
  .caret {
164
186
  border-top: 0;
165
- border-bottom: 4px solid @black;
187
+ border-bottom: @caret-width-base solid;
166
188
  content: "";
167
189
  }
168
190
  // Different positioning for bottom up menu
@@ -173,76 +195,21 @@
173
195
  }
174
196
  }
175
197
 
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
198
 
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);
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
+ }
231
213
  }
232
214
  }
233
215
 
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
- }