bootstrap-generators 2.3.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +12 -2
  3. data/{LICENSE.txt → MIT-LICENSE} +1 -3
  4. data/README.md +19 -64
  5. data/Rakefile +24 -22
  6. data/bootstrap-generators.gemspec +3 -1
  7. data/lib/bootstrap-generators.rb +12 -1
  8. data/lib/bootstrap/generators/version.rb +1 -1
  9. data/lib/generators/bootstrap/install/install_generator.rb +9 -24
  10. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.less +498 -179
  11. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.scss +620 -0
  12. data/lib/generators/bootstrap/install/templates/assets/stylesheets/{fluid.css → starter.css} +6 -6
  13. data/lib/generators/bootstrap/install/templates/assets/stylesheets/{fluid.css.less → starter.less} +7 -7
  14. data/lib/generators/bootstrap/install/templates/assets/stylesheets/{fluid.css.scss → starter.scss} +7 -8
  15. data/lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.erb +11 -9
  16. data/lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.haml +9 -8
  17. data/lib/generators/bootstrap/install/templates/layouts/starter.html.erb +50 -0
  18. data/lib/generators/bootstrap/install/templates/layouts/{hero.html.haml → starter.html.haml} +0 -0
  19. data/lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/edit.html.erb +3 -3
  20. data/lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/index.html.erb +25 -25
  21. data/lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/new.html.erb +2 -2
  22. data/lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/show.html.erb +5 -5
  23. data/lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/edit.html.haml +3 -3
  24. data/lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/index.html.haml +20 -19
  25. data/lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/new.html.haml +2 -2
  26. data/lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/show.html.haml +5 -5
  27. data/readme-template.md.erb +5 -48
  28. data/test/lib/generators/bootstrap/install_generator_test.rb +3 -33
  29. data/vendor/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  30. data/vendor/assets/fonts/glyphicons-halflings-regular.svg +228 -0
  31. data/vendor/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  32. data/vendor/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  33. data/vendor/assets/javascripts/bootstrap-ie.js +2 -0
  34. data/vendor/assets/javascripts/bootstrap-ie/html5shiv.js +8 -0
  35. data/vendor/assets/javascripts/bootstrap-ie/respond.min.js +6 -0
  36. data/vendor/assets/javascripts/bootstrap.js +12 -13
  37. data/vendor/assets/javascripts/bootstrap/affix.js +126 -0
  38. data/vendor/assets/javascripts/{bootstrap-alert.js → bootstrap/alert.js} +35 -36
  39. data/vendor/assets/javascripts/bootstrap/button.js +109 -0
  40. data/vendor/assets/javascripts/bootstrap/carousel.js +217 -0
  41. data/vendor/assets/javascripts/bootstrap/collapse.js +179 -0
  42. data/vendor/assets/javascripts/bootstrap/dropdown.js +154 -0
  43. data/vendor/assets/javascripts/bootstrap/modal.js +246 -0
  44. data/vendor/assets/javascripts/bootstrap/popover.js +117 -0
  45. data/vendor/assets/javascripts/bootstrap/scrollspy.js +158 -0
  46. data/vendor/assets/javascripts/bootstrap/tab.js +135 -0
  47. data/vendor/assets/javascripts/bootstrap/tooltip.js +386 -0
  48. data/vendor/assets/javascripts/bootstrap/transition.js +56 -0
  49. data/vendor/assets/stylesheets/bootstrap.css +4638 -4000
  50. data/vendor/twitter/bootstrap/less/alerts.less +46 -58
  51. data/vendor/twitter/bootstrap/less/badges.less +51 -0
  52. data/vendor/twitter/bootstrap/less/bootstrap.less +27 -31
  53. data/vendor/twitter/bootstrap/less/breadcrumbs.less +7 -8
  54. data/vendor/twitter/bootstrap/less/button-groups.less +173 -154
  55. data/vendor/twitter/bootstrap/less/buttons.less +97 -165
  56. data/vendor/twitter/bootstrap/less/carousel.less +115 -64
  57. data/vendor/twitter/bootstrap/less/close.less +20 -19
  58. data/vendor/twitter/bootstrap/less/code.less +17 -22
  59. data/vendor/twitter/bootstrap/less/component-animations.less +10 -3
  60. data/vendor/twitter/bootstrap/less/dropdowns.less +92 -147
  61. data/vendor/twitter/bootstrap/less/forms.less +224 -561
  62. data/vendor/twitter/bootstrap/less/glyphicons.less +232 -0
  63. data/vendor/twitter/bootstrap/less/grid.less +336 -11
  64. data/vendor/twitter/bootstrap/less/input-groups.less +127 -0
  65. data/vendor/twitter/bootstrap/less/jumbotron.less +40 -0
  66. data/vendor/twitter/bootstrap/less/labels.less +58 -0
  67. data/vendor/twitter/bootstrap/less/list-group.less +88 -0
  68. data/vendor/twitter/bootstrap/less/media.less +8 -7
  69. data/vendor/twitter/bootstrap/less/mixins.less +487 -466
  70. data/vendor/twitter/bootstrap/less/modals.less +98 -52
  71. data/vendor/twitter/bootstrap/less/navbar.less +507 -383
  72. data/vendor/twitter/bootstrap/less/navs.less +169 -349
  73. data/vendor/twitter/bootstrap/less/normalize.less +396 -0
  74. data/vendor/twitter/bootstrap/less/pager.less +45 -33
  75. data/vendor/twitter/bootstrap/less/pagination.less +65 -105
  76. data/vendor/twitter/bootstrap/less/panels.less +148 -0
  77. data/vendor/twitter/bootstrap/less/popovers.less +51 -51
  78. data/vendor/twitter/bootstrap/less/print.less +100 -0
  79. data/vendor/twitter/bootstrap/less/progress-bars.less +28 -55
  80. data/vendor/twitter/bootstrap/less/responsive-utilities.less +195 -34
  81. data/vendor/twitter/bootstrap/less/scaffolding.less +101 -24
  82. data/vendor/twitter/bootstrap/less/tables.less +170 -178
  83. data/vendor/twitter/bootstrap/less/theme.less +232 -0
  84. data/vendor/twitter/bootstrap/less/thumbnails.less +11 -33
  85. data/vendor/twitter/bootstrap/less/tooltip.less +45 -20
  86. data/vendor/twitter/bootstrap/less/type.less +100 -109
  87. data/vendor/twitter/bootstrap/less/utilities.less +19 -7
  88. data/vendor/twitter/bootstrap/less/variables.less +498 -179
  89. data/vendor/twitter/bootstrap/less/wells.less +7 -7
  90. data/vendor/twitter/bootstrap/sass/_alerts.scss +46 -58
  91. data/vendor/twitter/bootstrap/sass/_badges.scss +51 -0
  92. data/vendor/twitter/bootstrap/sass/_breadcrumbs.scss +8 -9
  93. data/vendor/twitter/bootstrap/sass/_button-groups.scss +173 -154
  94. data/vendor/twitter/bootstrap/sass/_buttons.scss +97 -165
  95. data/vendor/twitter/bootstrap/sass/_carousel.scss +116 -65
  96. data/vendor/twitter/bootstrap/sass/_close.scss +9 -8
  97. data/vendor/twitter/bootstrap/sass/_code.scss +16 -21
  98. data/vendor/twitter/bootstrap/sass/_component-animations.scss +10 -3
  99. data/vendor/twitter/bootstrap/sass/_dropdowns.scss +94 -148
  100. data/vendor/twitter/bootstrap/sass/_forms.scss +220 -559
  101. data/vendor/twitter/bootstrap/sass/_glyphicons.scss +232 -0
  102. data/vendor/twitter/bootstrap/sass/_grid.scss +336 -11
  103. data/vendor/twitter/bootstrap/sass/_input-groups.scss +127 -0
  104. data/vendor/twitter/bootstrap/sass/_jumbotron.scss +40 -0
  105. data/vendor/twitter/bootstrap/sass/_labels.scss +58 -0
  106. data/vendor/twitter/bootstrap/sass/_list-group.scss +88 -0
  107. data/vendor/twitter/bootstrap/sass/_media.scss +8 -7
  108. data/vendor/twitter/bootstrap/sass/_mixins.scss +465 -433
  109. data/vendor/twitter/bootstrap/sass/_modals.scss +102 -52
  110. data/vendor/twitter/bootstrap/sass/_navbar.scss +511 -383
  111. data/vendor/twitter/bootstrap/sass/_navs.scss +169 -349
  112. data/vendor/twitter/bootstrap/sass/_normalize.scss +396 -0
  113. data/vendor/twitter/bootstrap/sass/_pager.scss +45 -33
  114. data/vendor/twitter/bootstrap/sass/_pagination.scss +65 -105
  115. data/vendor/twitter/bootstrap/sass/_panels.scss +148 -0
  116. data/vendor/twitter/bootstrap/sass/_popovers.scss +51 -51
  117. data/vendor/twitter/bootstrap/sass/_print.scss +100 -0
  118. data/vendor/twitter/bootstrap/sass/_progress-bars.scss +28 -55
  119. data/vendor/twitter/bootstrap/sass/_responsive-utilities.scss +180 -45
  120. data/vendor/twitter/bootstrap/sass/_scaffolding.scss +101 -24
  121. data/vendor/twitter/bootstrap/sass/_tables.scss +169 -168
  122. data/vendor/twitter/bootstrap/sass/_theme.scss +232 -0
  123. data/vendor/twitter/bootstrap/sass/_thumbnails.scss +11 -33
  124. data/vendor/twitter/bootstrap/sass/_tooltip.scss +45 -20
  125. data/vendor/twitter/bootstrap/sass/_type.scss +101 -110
  126. data/vendor/twitter/bootstrap/sass/_utilities.scss +19 -22
  127. data/vendor/twitter/bootstrap/sass/_variables.scss +498 -179
  128. data/vendor/twitter/bootstrap/sass/_wells.scss +7 -7
  129. data/vendor/twitter/bootstrap/sass/bootstrap.scss +29 -33
  130. metadata +47 -56
  131. data/lib/bootstrap/generators/engine.rb +0 -14
  132. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.css.scss +0 -301
  133. data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css +0 -18
  134. data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css.less +0 -19
  135. data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css.scss +0 -19
  136. data/lib/generators/bootstrap/install/templates/config/initializers/simple_form.rb +0 -176
  137. data/lib/generators/bootstrap/install/templates/config/locales/simple_form.en.yml +0 -24
  138. data/lib/generators/bootstrap/install/templates/form_builders/simple_form/_form.html.erb +0 -13
  139. data/lib/generators/bootstrap/install/templates/form_builders/simple_form/_form.html.haml +0 -10
  140. data/lib/generators/bootstrap/install/templates/layouts/fluid.html.erb +0 -80
  141. data/lib/generators/bootstrap/install/templates/layouts/fluid.html.haml +0 -94
  142. data/lib/generators/bootstrap/install/templates/layouts/hero.html.erb +0 -53
  143. data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
  144. data/vendor/assets/images/glyphicons-halflings.png +0 -0
  145. data/vendor/assets/javascripts/bootstrap-affix.js +0 -117
  146. data/vendor/assets/javascripts/bootstrap-button.js +0 -105
  147. data/vendor/assets/javascripts/bootstrap-carousel.js +0 -207
  148. data/vendor/assets/javascripts/bootstrap-collapse.js +0 -167
  149. data/vendor/assets/javascripts/bootstrap-dropdown.js +0 -169
  150. data/vendor/assets/javascripts/bootstrap-modal.js +0 -247
  151. data/vendor/assets/javascripts/bootstrap-popover.js +0 -114
  152. data/vendor/assets/javascripts/bootstrap-scrollspy.js +0 -162
  153. data/vendor/assets/javascripts/bootstrap-tab.js +0 -144
  154. data/vendor/assets/javascripts/bootstrap-tooltip.js +0 -361
  155. data/vendor/assets/javascripts/bootstrap-transition.js +0 -60
  156. data/vendor/assets/javascripts/bootstrap-typeahead.js +0 -335
  157. data/vendor/assets/stylesheets/bootstrap-responsive.css +0 -1109
  158. data/vendor/twitter/bootstrap/less/accordion.less +0 -34
  159. data/vendor/twitter/bootstrap/less/hero-unit.less +0 -25
  160. data/vendor/twitter/bootstrap/less/labels-badges.less +0 -84
  161. data/vendor/twitter/bootstrap/less/layouts.less +0 -16
  162. data/vendor/twitter/bootstrap/less/reset.less +0 -216
  163. data/vendor/twitter/bootstrap/less/responsive-1200px-min.less +0 -28
  164. data/vendor/twitter/bootstrap/less/responsive-767px-max.less +0 -193
  165. data/vendor/twitter/bootstrap/less/responsive-768px-979px.less +0 -19
  166. data/vendor/twitter/bootstrap/less/responsive-navbar.less +0 -189
  167. data/vendor/twitter/bootstrap/less/responsive.less +0 -48
  168. data/vendor/twitter/bootstrap/less/sprites.less +0 -197
  169. data/vendor/twitter/bootstrap/sass/_accordion.scss +0 -34
  170. data/vendor/twitter/bootstrap/sass/_hero-unit.scss +0 -25
  171. data/vendor/twitter/bootstrap/sass/_labels-badges.scss +0 -83
  172. data/vendor/twitter/bootstrap/sass/_layouts.scss +0 -16
  173. data/vendor/twitter/bootstrap/sass/_reset.scss +0 -216
  174. data/vendor/twitter/bootstrap/sass/_responsive-1200px-min.scss +0 -28
  175. data/vendor/twitter/bootstrap/sass/_responsive-767px-max.scss +0 -193
  176. data/vendor/twitter/bootstrap/sass/_responsive-768px-979px.scss +0 -19
  177. data/vendor/twitter/bootstrap/sass/_responsive-navbar.scss +0 -189
  178. data/vendor/twitter/bootstrap/sass/_sprites.scss +0 -197
  179. data/vendor/twitter/bootstrap/sass/responsive.scss +0 -48
@@ -7,73 +7,61 @@
7
7
  // -------------------------
8
8
 
9
9
  .alert {
10
- padding: 8px 35px 8px 14px;
11
- margin-bottom: @baseLineHeight;
12
- text-shadow: 0 1px 0 rgba(255,255,255,.5);
13
- background-color: @warningBackground;
14
- border: 1px solid @warningBorder;
15
- .border-radius(@baseBorderRadius);
16
- }
17
- .alert,
18
- .alert h4 {
19
- // Specified for the h4 to prevent conflicts of changing @headingsColor
20
- color: @warningText;
21
- }
22
- .alert h4 {
23
- margin: 0;
24
- }
10
+ padding: @alert-padding;
11
+ margin-bottom: @line-height-computed;
12
+ border: 1px solid transparent;
13
+ border-radius: @alert-border-radius;
25
14
 
26
- // Adjust close link position
27
- .alert .close {
28
- position: relative;
29
- top: -2px;
30
- right: -21px;
31
- line-height: @baseLineHeight;
15
+ // Headings for larger alerts
16
+ h4 {
17
+ margin-top: 0;
18
+ // Specified for the h4 to prevent conflicts of changing @headingsColor
19
+ color: inherit;
20
+ }
21
+ // Provide class for links that match alerts
22
+ .alert-link {
23
+ font-weight: @alert-link-font-weight;
24
+ }
25
+
26
+ // Improve alignment and spacing of inner content
27
+ > p,
28
+ > ul {
29
+ margin-bottom: 0;
30
+ }
31
+ > p + p {
32
+ margin-top: 5px;
33
+ }
32
34
  }
33
35
 
36
+ // Dismissable alerts
37
+ //
38
+ // Expand the right padding and account for the close button's positioning.
39
+
40
+ .alert-dismissable {
41
+ padding-right: (@alert-padding + 20);
42
+
43
+ // Adjust close link position
44
+ .close {
45
+ position: relative;
46
+ top: -2px;
47
+ right: -21px;
48
+ color: inherit;
49
+ }
50
+ }
34
51
 
35
52
  // Alternate styles
36
- // -------------------------
53
+ //
54
+ // Generate contextual modifier classes for colorizing the alert.
37
55
 
38
56
  .alert-success {
39
- background-color: @successBackground;
40
- border-color: @successBorder;
41
- color: @successText;
42
- }
43
- .alert-success h4 {
44
- color: @successText;
45
- }
46
- .alert-danger,
47
- .alert-error {
48
- background-color: @errorBackground;
49
- border-color: @errorBorder;
50
- color: @errorText;
51
- }
52
- .alert-danger h4,
53
- .alert-error h4 {
54
- color: @errorText;
57
+ .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text);
55
58
  }
56
59
  .alert-info {
57
- background-color: @infoBackground;
58
- border-color: @infoBorder;
59
- color: @infoText;
60
- }
61
- .alert-info h4 {
62
- color: @infoText;
63
- }
64
-
65
-
66
- // Block alerts
67
- // -------------------------
68
-
69
- .alert-block {
70
- padding-top: 14px;
71
- padding-bottom: 14px;
60
+ .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text);
72
61
  }
73
- .alert-block > p,
74
- .alert-block > ul {
75
- margin-bottom: 0;
62
+ .alert-warning {
63
+ .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text);
76
64
  }
77
- .alert-block p + p {
78
- margin-top: 5px;
65
+ .alert-danger {
66
+ .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text);
79
67
  }
@@ -0,0 +1,51 @@
1
+ //
2
+ // Badges
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Base classes
7
+ .badge {
8
+ display: inline-block;
9
+ min-width: 10px;
10
+ padding: 3px 7px;
11
+ font-size: @font-size-small;
12
+ font-weight: @badge-font-weight;
13
+ color: @badge-color;
14
+ line-height: @badge-line-height;
15
+ vertical-align: baseline;
16
+ white-space: nowrap;
17
+ text-align: center;
18
+ background-color: @badge-bg;
19
+ border-radius: @badge-border-radius;
20
+
21
+ // Empty badges collapse automatically (not available in IE8)
22
+ &:empty {
23
+ display: none;
24
+ }
25
+ }
26
+
27
+ // Hover state, but only for links
28
+ a.badge {
29
+ &:hover,
30
+ &:focus {
31
+ color: @badge-link-hover-color;
32
+ text-decoration: none;
33
+ cursor: pointer;
34
+ }
35
+ }
36
+
37
+ // Quick fix for labels/badges in buttons
38
+ .btn .badge {
39
+ position: relative;
40
+ top: -1px;
41
+ }
42
+
43
+ // Account for counters in navs
44
+ a.list-group-item.active > .badge,
45
+ .nav-pills > .active > a > .badge {
46
+ color: @badge-active-color;
47
+ background-color: @badge-active-bg;
48
+ }
49
+ .nav-pills > li > a > .badge {
50
+ margin-left: 3px;
51
+ }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap v2.3.2
2
+ * Bootstrap v3.0.0
3
3
  *
4
4
  * Copyright 2013 Twitter, Inc
5
5
  * Licensed under the Apache License v2.0
@@ -9,55 +9,51 @@
9
9
  */
10
10
 
11
11
  // Core variables and mixins
12
- @import "variables.less"; // Modify this for custom colors, font-sizes, etc
12
+ @import "variables.less";
13
13
  @import "mixins.less";
14
14
 
15
- // CSS Reset
16
- @import "reset.less";
15
+ // Reset
16
+ @import "normalize.less";
17
+ @import "print.less";
17
18
 
18
- // Grid system and page structure
19
+ // Core CSS
19
20
  @import "scaffolding.less";
20
- @import "grid.less";
21
- @import "layouts.less";
22
-
23
- // Base CSS
24
21
  @import "type.less";
25
22
  @import "code.less";
26
- @import "forms.less";
23
+ @import "grid.less";
27
24
  @import "tables.less";
25
+ @import "forms.less";
26
+ @import "buttons.less";
28
27
 
29
- // Components: common
30
- @import "sprites.less";
31
- @import "dropdowns.less";
32
- @import "wells.less";
28
+ // Components
33
29
  @import "component-animations.less";
34
- @import "close.less";
35
-
36
- // Components: Buttons & Alerts
37
- @import "buttons.less";
30
+ @import "glyphicons.less";
31
+ @import "dropdowns.less";
38
32
  @import "button-groups.less";
39
- @import "alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less
40
-
41
- // Components: Nav
33
+ @import "input-groups.less";
42
34
  @import "navs.less";
43
35
  @import "navbar.less";
44
36
  @import "breadcrumbs.less";
45
37
  @import "pagination.less";
46
38
  @import "pager.less";
39
+ @import "labels.less";
40
+ @import "badges.less";
41
+ @import "jumbotron.less";
42
+ @import "thumbnails.less";
43
+ @import "alerts.less";
44
+ @import "progress-bars.less";
45
+ @import "media.less";
46
+ @import "list-group.less";
47
+ @import "panels.less";
48
+ @import "wells.less";
49
+ @import "close.less";
47
50
 
48
- // Components: Popovers
51
+ // Components w/ JavaScript
49
52
  @import "modals.less";
50
53
  @import "tooltip.less";
51
54
  @import "popovers.less";
52
-
53
- // Components: Misc
54
- @import "thumbnails.less";
55
- @import "media.less";
56
- @import "labels-badges.less";
57
- @import "progress-bars.less";
58
- @import "accordion.less";
59
55
  @import "carousel.less";
60
- @import "hero-unit.less";
61
56
 
62
57
  // Utility classes
63
- @import "utilities.less"; // Has to be last to override when necessary
58
+ @import "utilities.less";
59
+ @import "responsive-utilities.less";
@@ -5,20 +5,19 @@
5
5
 
6
6
  .breadcrumb {
7
7
  padding: 8px 15px;
8
- margin: 0 0 @baseLineHeight;
8
+ margin-bottom: @line-height-computed;
9
9
  list-style: none;
10
- background-color: #f5f5f5;
11
- .border-radius(@baseBorderRadius);
10
+ background-color: @breadcrumb-bg;
11
+ border-radius: @border-radius-base;
12
12
  > li {
13
13
  display: inline-block;
14
- .ie7-inline-block();
15
- text-shadow: 0 1px 0 @white;
16
- > .divider {
14
+ &+li:before {
15
+ content: "/\00a0"; // Unicode space added since inline-block means non-collapsing white-space
17
16
  padding: 0 5px;
18
- color: #ccc;
17
+ color: @breadcrumb-color;
19
18
  }
20
19
  }
21
20
  > .active {
22
- color: @grayLight;
21
+ color: @breadcrumb-active-color;
23
22
  }
24
23
  }
@@ -2,90 +2,119 @@
2
2
  // Button groups
3
3
  // --------------------------------------------------
4
4
 
5
+ // Button carets
6
+ //
7
+ // Match the button text color to the arrow/caret for indicating dropdown-ness.
8
+
9
+ .caret {
10
+ .btn-default & {
11
+ border-top-color: @btn-default-color;
12
+ }
13
+ .btn-primary &,
14
+ .btn-success &,
15
+ .btn-warning &,
16
+ .btn-danger &,
17
+ .btn-info & {
18
+ border-top-color: #fff;
19
+ }
20
+ }
21
+ .dropup {
22
+ & .btn-default .caret {
23
+ border-bottom-color: @btn-default-color;
24
+ }
25
+ .btn-primary,
26
+ .btn-success,
27
+ .btn-warning,
28
+ .btn-danger,
29
+ .btn-info {
30
+ .caret {
31
+ border-bottom-color: #fff;
32
+ }
33
+ }
34
+ }
5
35
 
6
36
  // Make the div behave like a button
7
- .btn-group {
37
+ .btn-group,
38
+ .btn-group-vertical {
8
39
  position: relative;
9
40
  display: inline-block;
10
- .ie7-inline-block();
11
- font-size: 0; // remove as part 1 of font-size inline-block hack
12
41
  vertical-align: middle; // match .btn alignment given font-size hack above
13
- white-space: nowrap; // prevent buttons from wrapping when in tight spaces (e.g., the table on the tests page)
14
- .ie7-restore-left-whitespace();
42
+ > .btn {
43
+ position: relative;
44
+ float: left;
45
+ // Bring the "active" button to the front
46
+ &:hover,
47
+ &:focus,
48
+ &:active,
49
+ &.active {
50
+ z-index: 2;
51
+ }
52
+ &:focus {
53
+ // Remove focus outline when dropdown JS adds it after closing the menu
54
+ outline: none;
55
+ }
56
+ }
15
57
  }
16
58
 
17
- // Space out series of button groups
18
- .btn-group + .btn-group {
19
- margin-left: 5px;
59
+ // Prevent double borders when buttons are next to each other
60
+ .btn-group {
61
+ .btn + .btn,
62
+ .btn + .btn-group,
63
+ .btn-group + .btn,
64
+ .btn-group + .btn-group {
65
+ margin-left: -1px;
66
+ }
20
67
  }
21
68
 
22
69
  // Optional: Group multiple button groups together for a toolbar
23
70
  .btn-toolbar {
24
- font-size: 0; // Hack to remove whitespace that results from using inline-block
25
- margin-top: @baseLineHeight / 2;
26
- margin-bottom: @baseLineHeight / 2;
27
- > .btn + .btn,
28
- > .btn-group + .btn,
29
- > .btn + .btn-group {
30
- margin-left: 5px;
31
- }
32
- }
71
+ .clearfix();
33
72
 
34
- // Float them, remove border radius, then re-add to first and last elements
35
- .btn-group > .btn {
36
- position: relative;
37
- .border-radius(0);
38
- }
39
- .btn-group > .btn + .btn {
40
- margin-left: -1px;
41
- }
42
- .btn-group > .btn,
43
- .btn-group > .dropdown-menu,
44
- .btn-group > .popover {
45
- font-size: @baseFontSize; // redeclare as part 2 of font-size inline-block hack
73
+ .btn-group {
74
+ float: left;
75
+ }
76
+ // Space out series of button groups
77
+ > .btn,
78
+ > .btn-group {
79
+ + .btn,
80
+ + .btn-group {
81
+ margin-left: 5px;
82
+ }
83
+ }
46
84
  }
47
85
 
48
- // Reset fonts for other sizes
49
- .btn-group > .btn-mini {
50
- font-size: @fontSizeMini;
51
- }
52
- .btn-group > .btn-small {
53
- font-size: @fontSizeSmall;
54
- }
55
- .btn-group > .btn-large {
56
- font-size: @fontSizeLarge;
86
+ .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
87
+ border-radius: 0;
57
88
  }
58
89
 
59
90
  // Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match
60
91
  .btn-group > .btn:first-child {
61
92
  margin-left: 0;
62
- .border-top-left-radius(@baseBorderRadius);
63
- .border-bottom-left-radius(@baseBorderRadius);
93
+ &:not(:last-child):not(.dropdown-toggle) {
94
+ .border-right-radius(0);
95
+ }
64
96
  }
65
97
  // Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it
66
- .btn-group > .btn:last-child,
67
- .btn-group > .dropdown-toggle {
68
- .border-top-right-radius(@baseBorderRadius);
69
- .border-bottom-right-radius(@baseBorderRadius);
98
+ .btn-group > .btn:last-child:not(:first-child),
99
+ .btn-group > .dropdown-toggle:not(:first-child) {
100
+ .border-left-radius(0);
70
101
  }
71
- // Reset corners for large buttons
72
- .btn-group > .btn.large:first-child {
73
- margin-left: 0;
74
- .border-top-left-radius(@borderRadiusLarge);
75
- .border-bottom-left-radius(@borderRadiusLarge);
102
+
103
+ // Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group)
104
+ .btn-group > .btn-group {
105
+ float: left;
76
106
  }
77
- .btn-group > .btn.large:last-child,
78
- .btn-group > .large.dropdown-toggle {
79
- .border-top-right-radius(@borderRadiusLarge);
80
- .border-bottom-right-radius(@borderRadiusLarge);
107
+ .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
108
+ border-radius: 0;
81
109
  }
82
-
83
- // On hover/focus/active, bring the proper btn to front
84
- .btn-group > .btn:hover,
85
- .btn-group > .btn:focus,
86
- .btn-group > .btn:active,
87
- .btn-group > .btn.active {
88
- z-index: 2;
110
+ .btn-group > .btn-group:first-child {
111
+ > .btn:last-child,
112
+ > .dropdown-toggle {
113
+ .border-right-radius(0);
114
+ }
115
+ }
116
+ .btn-group > .btn-group:last-child > .btn:first-child {
117
+ .border-left-radius(0);
89
118
  }
90
119
 
91
120
  // On active and open, don't show outline
@@ -95,6 +124,14 @@
95
124
  }
96
125
 
97
126
 
127
+ // Sizing
128
+ //
129
+ // Remix the default button sizing classes into new ones for easier manipulation.
130
+
131
+ .btn-group-xs > .btn { .btn-xs(); }
132
+ .btn-group-sm > .btn { .btn-sm(); }
133
+ .btn-group-lg > .btn { .btn-lg(); }
134
+
98
135
 
99
136
  // Split button dropdowns
100
137
  // ----------------------
@@ -103,127 +140,109 @@
103
140
  .btn-group > .btn + .dropdown-toggle {
104
141
  padding-left: 8px;
105
142
  padding-right: 8px;
106
- .box-shadow(~"inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)");
107
- *padding-top: 5px;
108
- *padding-bottom: 5px;
109
- }
110
- .btn-group > .btn-mini + .dropdown-toggle {
111
- padding-left: 5px;
112
- padding-right: 5px;
113
- *padding-top: 2px;
114
- *padding-bottom: 2px;
115
143
  }
116
- .btn-group > .btn-small + .dropdown-toggle {
117
- *padding-top: 5px;
118
- *padding-bottom: 4px;
119
- }
120
- .btn-group > .btn-large + .dropdown-toggle {
144
+ .btn-group > .btn-lg + .dropdown-toggle {
121
145
  padding-left: 12px;
122
146
  padding-right: 12px;
123
- *padding-top: 7px;
124
- *padding-bottom: 7px;
125
147
  }
126
148
 
127
- .btn-group.open {
128
-
129
- // The clickable button for toggling the menu
130
- // Remove the gradient and set the same inset shadow as the :active state
131
- .dropdown-toggle {
132
- background-image: none;
133
- .box-shadow(~"inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)");
134
- }
135
-
136
- // Keep the hover's background when dropdown is open
137
- .btn.dropdown-toggle {
138
- background-color: @btnBackgroundHighlight;
139
- }
140
- .btn-primary.dropdown-toggle {
141
- background-color: @btnPrimaryBackgroundHighlight;
142
- }
143
- .btn-warning.dropdown-toggle {
144
- background-color: @btnWarningBackgroundHighlight;
145
- }
146
- .btn-danger.dropdown-toggle {
147
- background-color: @btnDangerBackgroundHighlight;
148
- }
149
- .btn-success.dropdown-toggle {
150
- background-color: @btnSuccessBackgroundHighlight;
151
- }
152
- .btn-info.dropdown-toggle {
153
- background-color: @btnInfoBackgroundHighlight;
154
- }
155
- .btn-inverse.dropdown-toggle {
156
- background-color: @btnInverseBackgroundHighlight;
157
- }
149
+ // The clickable button for toggling the menu
150
+ // Remove the gradient and set the same inset shadow as the :active state
151
+ .btn-group.open .dropdown-toggle {
152
+ .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));
158
153
  }
159
154
 
160
155
 
161
156
  // Reposition the caret
162
157
  .btn .caret {
163
- margin-top: 8px;
164
158
  margin-left: 0;
165
159
  }
166
160
  // Carets in other button sizes
167
- .btn-large .caret {
168
- margin-top: 6px;
169
- }
170
- .btn-large .caret {
171
- border-left-width: 5px;
172
- border-right-width: 5px;
173
- border-top-width: 5px;
174
- }
175
- .btn-mini .caret,
176
- .btn-small .caret {
177
- margin-top: 8px;
161
+ .btn-lg .caret {
162
+ border-width: @caret-width-large @caret-width-large 0;
163
+ border-bottom-width: 0;
178
164
  }
179
165
  // Upside down carets for .dropup
180
- .dropup .btn-large .caret {
181
- border-bottom-width: 5px;
166
+ .dropup .btn-lg .caret {
167
+ border-width: 0 @caret-width-large @caret-width-large;
182
168
  }
183
169
 
184
170
 
185
-
186
- // Account for other colors
187
- .btn-primary,
188
- .btn-warning,
189
- .btn-danger,
190
- .btn-info,
191
- .btn-success,
192
- .btn-inverse {
193
- .caret {
194
- border-top-color: @white;
195
- border-bottom-color: @white;
196
- }
197
- }
198
-
199
-
200
-
201
171
  // Vertical button groups
202
172
  // ----------------------
203
173
 
204
174
  .btn-group-vertical {
205
- display: inline-block; // makes buttons only take up the width they need
206
- .ie7-inline-block();
175
+ > .btn,
176
+ > .btn-group {
177
+ display: block;
178
+ float: none;
179
+ width: 100%;
180
+ max-width: 100%;
181
+ }
182
+
183
+ // Clear floats so dropdown menus can be properly placed
184
+ > .btn-group {
185
+ .clearfix();
186
+ > .btn {
187
+ float: none;
188
+ }
189
+ }
190
+
191
+ > .btn + .btn,
192
+ > .btn + .btn-group,
193
+ > .btn-group + .btn,
194
+ > .btn-group + .btn-group {
195
+ margin-top: -1px;
196
+ margin-left: 0;
197
+ }
207
198
  }
199
+
208
200
  .btn-group-vertical > .btn {
209
- display: block;
210
- float: none;
211
- max-width: 100%;
212
- .border-radius(0);
201
+ &:not(:first-child):not(:last-child) {
202
+ border-radius: 0;
203
+ }
204
+ &:first-child:not(:last-child) {
205
+ border-top-right-radius: @border-radius-base;
206
+ .border-bottom-radius(0);
207
+ }
208
+ &:last-child:not(:first-child) {
209
+ border-bottom-left-radius: @border-radius-base;
210
+ .border-top-radius(0);
211
+ }
213
212
  }
214
- .btn-group-vertical > .btn + .btn {
215
- margin-left: 0;
216
- margin-top: -1px;
213
+ .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
214
+ border-radius: 0;
217
215
  }
218
- .btn-group-vertical > .btn:first-child {
219
- .border-radius(@baseBorderRadius @baseBorderRadius 0 0);
216
+ .btn-group-vertical > .btn-group:first-child {
217
+ > .btn:last-child,
218
+ > .dropdown-toggle {
219
+ .border-bottom-radius(0);
220
+ }
220
221
  }
221
- .btn-group-vertical > .btn:last-child {
222
- .border-radius(0 0 @baseBorderRadius @baseBorderRadius);
222
+ .btn-group-vertical > .btn-group:last-child > .btn:first-child {
223
+ .border-top-radius(0);
223
224
  }
224
- .btn-group-vertical > .btn-large:first-child {
225
- .border-radius(@borderRadiusLarge @borderRadiusLarge 0 0);
225
+
226
+
227
+
228
+ // Justified button groups
229
+ // ----------------------
230
+
231
+ .btn-group-justified {
232
+ display: table;
233
+ width: 100%;
234
+ table-layout: fixed;
235
+ border-collapse: separate;
236
+ .btn {
237
+ float: none;
238
+ display: table-cell;
239
+ width: 1%;
240
+ }
226
241
  }
227
- .btn-group-vertical > .btn-large:last-child {
228
- .border-radius(0 0 @borderRadiusLarge @borderRadiusLarge);
242
+
243
+
244
+ // Checkbox and radio options
245
+ [data-toggle="buttons"] > .btn > input[type="radio"],
246
+ [data-toggle="buttons"] > .btn > input[type="checkbox"] {
247
+ display: none;
229
248
  }