less-rails-bootstrap 2.3.3 → 3.0.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. data/.gitignore +1 -0
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +7 -11
  4. data/lib/less/rails/bootstrap/version.rb +1 -1
  5. data/scripts/update_bootstrap.sh +37 -8
  6. data/test/cases/usage_css_spec.rb +15 -12
  7. data/test/cases/usage_js_spec.rb +4 -4
  8. data/test/dummy_app/app/assets/stylesheets/fonts.css.less +2 -0
  9. data/test/dummy_app/app/assets/stylesheets/framework.css.less +4 -2
  10. data/test/dummy_app/app/assets/stylesheets/individual.css.less +2 -2
  11. data/test/spec_helper.rb +1 -2
  12. data/vendor/assets/javascripts/twitter/bootstrap.js +0 -1
  13. data/vendor/assets/javascripts/twitter/bootstrap/affix.js +58 -49
  14. data/vendor/assets/javascripts/twitter/bootstrap/alert.js +36 -37
  15. data/vendor/assets/javascripts/twitter/bootstrap/button.js +41 -39
  16. data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +131 -125
  17. data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +108 -96
  18. data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +72 -87
  19. data/vendor/assets/javascripts/twitter/bootstrap/modal.js +149 -155
  20. data/vendor/assets/javascripts/twitter/bootstrap/popover.js +60 -59
  21. data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +103 -107
  22. data/vendor/assets/javascripts/twitter/bootstrap/tab.js +73 -82
  23. data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +258 -255
  24. data/vendor/assets/javascripts/twitter/bootstrap/transition.js +34 -38
  25. data/vendor/frameworks/twitter/bootstrap/accordion.less +9 -12
  26. data/vendor/frameworks/twitter/bootstrap/alerts.less +43 -53
  27. data/vendor/frameworks/twitter/bootstrap/bootstrap.less +21 -21
  28. data/vendor/frameworks/twitter/bootstrap/breadcrumbs.less +7 -8
  29. data/vendor/frameworks/twitter/bootstrap/button-groups.less +93 -151
  30. data/vendor/frameworks/twitter/bootstrap/buttons.less +93 -164
  31. data/vendor/frameworks/twitter/bootstrap/carousel.less +110 -63
  32. data/vendor/frameworks/twitter/bootstrap/close.less +18 -17
  33. data/vendor/frameworks/twitter/bootstrap/code.less +14 -20
  34. data/vendor/frameworks/twitter/bootstrap/component-animations.less +10 -3
  35. data/vendor/frameworks/twitter/bootstrap/dropdowns.less +66 -143
  36. data/vendor/frameworks/twitter/bootstrap/forms.less +281 -548
  37. data/vendor/frameworks/twitter/bootstrap/grid.less +194 -11
  38. data/vendor/frameworks/twitter/bootstrap/media.less +8 -7
  39. data/vendor/frameworks/twitter/bootstrap/mixins.less +290 -446
  40. data/vendor/frameworks/twitter/bootstrap/modals.less +92 -51
  41. data/vendor/frameworks/twitter/bootstrap/navbar.less +285 -402
  42. data/vendor/frameworks/twitter/bootstrap/navs.less +176 -348
  43. data/vendor/frameworks/twitter/bootstrap/pager.less +45 -33
  44. data/vendor/frameworks/twitter/bootstrap/pagination.less +89 -104
  45. data/vendor/frameworks/twitter/bootstrap/popovers.less +53 -51
  46. data/vendor/frameworks/twitter/bootstrap/progress-bars.less +28 -45
  47. data/vendor/frameworks/twitter/bootstrap/responsive-utilities.less +92 -32
  48. data/vendor/frameworks/twitter/bootstrap/scaffolding.less +60 -18
  49. data/vendor/frameworks/twitter/bootstrap/tables.less +131 -164
  50. data/vendor/frameworks/twitter/bootstrap/thumbnails.less +20 -31
  51. data/vendor/frameworks/twitter/bootstrap/tooltip.less +45 -20
  52. data/vendor/frameworks/twitter/bootstrap/type.less +84 -99
  53. data/vendor/frameworks/twitter/bootstrap/utilities.less +17 -5
  54. data/vendor/frameworks/twitter/bootstrap/variables.less +446 -179
  55. data/vendor/frameworks/twitter/bootstrap/wells.less +5 -5
  56. metadata +41 -44
  57. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  58. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  59. data/vendor/assets/javascripts/twitter/bootstrap/typeahead.js +0 -335
  60. data/vendor/assets/stylesheets/twitter/bootstrap-responsive.css.less +0 -1
  61. data/vendor/assets/stylesheets/twitter/bootstrap.css.less +0 -1
  62. data/vendor/frameworks/twitter/bootstrap.less +0 -1
  63. data/vendor/frameworks/twitter/bootstrap/hero-unit.less +0 -25
  64. data/vendor/frameworks/twitter/bootstrap/labels-badges.less +0 -84
  65. data/vendor/frameworks/twitter/bootstrap/layouts.less +0 -16
  66. data/vendor/frameworks/twitter/bootstrap/reset.less +0 -216
  67. data/vendor/frameworks/twitter/bootstrap/responsive-1200px-min.less +0 -28
  68. data/vendor/frameworks/twitter/bootstrap/responsive-767px-max.less +0 -193
  69. data/vendor/frameworks/twitter/bootstrap/responsive-768px-979px.less +0 -19
  70. data/vendor/frameworks/twitter/bootstrap/responsive-navbar.less +0 -189
  71. data/vendor/frameworks/twitter/bootstrap/responsive.less +0 -48
  72. data/vendor/frameworks/twitter/bootstrap/sprites.less +0 -197
@@ -6,223 +6,152 @@
6
6
  // Base styles
7
7
  // --------------------------------------------------
8
8
 
9
- // Core
9
+ // Core styles
10
10
  .btn {
11
11
  display: inline-block;
12
- .ie7-inline-block();
13
- padding: 4px 12px;
12
+ padding: @padding-base-vertical @padding-base-horizontal;
14
13
  margin-bottom: 0; // For input.btn
15
- font-size: @baseFontSize;
16
- line-height: @baseLineHeight;
14
+ font-size: @font-size-base;
15
+ font-weight: 500;
16
+ line-height: @line-height-base;
17
17
  text-align: center;
18
18
  vertical-align: middle;
19
19
  cursor: pointer;
20
- .buttonBackground(@btnBackground, @btnBackgroundHighlight, @grayDark, 0 1px 1px rgba(255,255,255,.75));
21
- border: 1px solid @btnBorder;
22
- *border: 0; // Remove the border to prevent IE7's black border on input:focus
23
- border-bottom-color: darken(@btnBorder, 10%);
24
- .border-radius(@baseBorderRadius);
25
- .ie7-restore-left-whitespace(); // Give IE7 some love
26
- .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)");
27
-
28
- // Hover/focus state
29
- &:hover,
30
- &:focus {
31
- color: @grayDark;
32
- text-decoration: none;
33
- background-position: 0 -15px;
20
+ border: 1px solid transparent;
21
+ border-radius: @border-radius-base;
22
+ white-space: nowrap;
34
23
 
35
- // transition is only when going to hover/focus, otherwise the background
36
- // behind the gradient (there for IE<=9 fallback) gets mismatched
37
- .transition(background-position .1s linear);
24
+ &:focus {
25
+ .tab-focus();
38
26
  }
39
27
 
40
- // Focus state for keyboard and accessibility
28
+ &:hover,
41
29
  &:focus {
42
- .tab-focus();
30
+ color: @btn-hover-color;
31
+ text-decoration: none;
43
32
  }
44
33
 
45
- // Active state
46
- &.active,
47
- &:active {
48
- background-image: none;
34
+ &:active,
35
+ &.active {
49
36
  outline: 0;
50
- .box-shadow(~"inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)");
37
+ .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));
51
38
  }
52
39
 
53
- // Disabled state
54
40
  &.disabled,
55
- &[disabled] {
41
+ &[disabled],
42
+ fieldset[disabled] & {
56
43
  cursor: default;
57
- background-image: none;
58
- .opacity(65);
44
+ pointer-events: none; // Future-proof disabling of clicks
45
+ .opacity(.65);
59
46
  .box-shadow(none);
60
47
  }
61
48
 
62
49
  }
63
50
 
64
51
 
65
-
66
- // Button Sizes
67
- // --------------------------------------------------
68
-
69
- // Large
70
- .btn-large {
71
- padding: @paddingLarge;
72
- font-size: @fontSizeLarge;
73
- .border-radius(@borderRadiusLarge);
74
- }
75
- .btn-large [class^="icon-"],
76
- .btn-large [class*=" icon-"] {
77
- margin-top: 4px;
78
- }
79
-
80
- // Small
81
- .btn-small {
82
- padding: @paddingSmall;
83
- font-size: @fontSizeSmall;
84
- .border-radius(@borderRadiusSmall);
85
- }
86
- .btn-small [class^="icon-"],
87
- .btn-small [class*=" icon-"] {
88
- margin-top: 0;
89
- }
90
- .btn-mini [class^="icon-"],
91
- .btn-mini [class*=" icon-"] {
92
- margin-top: -1px;
93
- }
94
-
95
- // Mini
96
- .btn-mini {
97
- padding: @paddingMini;
98
- font-size: @fontSizeMini;
99
- .border-radius(@borderRadiusSmall);
100
- }
101
-
102
-
103
- // Block button
104
- // -------------------------
105
-
106
- .btn-block {
107
- display: block;
108
- width: 100%;
109
- padding-left: 0;
110
- padding-right: 0;
111
- .box-sizing(border-box);
112
- }
113
-
114
- // Vertically space out multiple block buttons
115
- .btn-block + .btn-block {
116
- margin-top: 5px;
117
- }
118
-
119
- // Specificity overrides
120
- input[type="submit"],
121
- input[type="reset"],
122
- input[type="button"] {
123
- &.btn-block {
124
- width: 100%;
125
- }
126
- }
127
-
128
-
129
-
130
52
  // Alternate buttons
131
53
  // --------------------------------------------------
132
54
 
133
- // Provide *some* extra contrast for those who can get it
134
- .btn-primary.active,
135
- .btn-warning.active,
136
- .btn-danger.active,
137
- .btn-success.active,
138
- .btn-info.active,
139
- .btn-inverse.active {
140
- color: rgba(255,255,255,.75);
55
+ .btn-default {
56
+ .btn-pseudo-states(@btn-default-color, @btn-default-bg, @btn-default-border);
141
57
  }
142
-
143
- // Set the backgrounds
144
- // -------------------------
145
58
  .btn-primary {
146
- .buttonBackground(@btnPrimaryBackground, @btnPrimaryBackgroundHighlight);
59
+ .btn-pseudo-states(@btn-primary-color, @btn-primary-bg, @btn-primary-border);
147
60
  }
148
- // Warning appears are orange
61
+ // Warning appears as orange
149
62
  .btn-warning {
150
- .buttonBackground(@btnWarningBackground, @btnWarningBackgroundHighlight);
63
+ .btn-pseudo-states(@btn-warning-color, @btn-warning-bg, @btn-warning-border);
151
64
  }
152
65
  // Danger and error appear as red
153
66
  .btn-danger {
154
- .buttonBackground(@btnDangerBackground, @btnDangerBackgroundHighlight);
67
+ .btn-pseudo-states(@btn-danger-color, @btn-danger-bg, @btn-danger-border);
155
68
  }
156
69
  // Success appears as green
157
70
  .btn-success {
158
- .buttonBackground(@btnSuccessBackground, @btnSuccessBackgroundHighlight);
71
+ .btn-pseudo-states(@btn-success-color, @btn-success-bg, @btn-success-border);
159
72
  }
160
- // Info appears as a neutral blue
73
+ // Info appears as blue-green
161
74
  .btn-info {
162
- .buttonBackground(@btnInfoBackground, @btnInfoBackgroundHighlight);
163
- }
164
- // Inverse appears as dark gray
165
- .btn-inverse {
166
- .buttonBackground(@btnInverseBackground, @btnInverseBackgroundHighlight);
75
+ .btn-pseudo-states(@btn-info-color, @btn-info-bg, @btn-info-border);
167
76
  }
168
77
 
169
78
 
170
- // Cross-browser Jank
171
- // --------------------------------------------------
79
+ // Link buttons
80
+ // -------------------------
172
81
 
173
- button.btn,
174
- input[type="submit"].btn {
82
+ // Make a button look and behave like a link
83
+ .btn-link {
84
+ color: @link-color;
85
+ font-weight: normal;
86
+ cursor: pointer;
87
+ border-radius: 0;
175
88
 
176
- // Firefox 3.6 only I believe
177
- &::-moz-focus-inner {
178
- padding: 0;
179
- border: 0;
89
+ &,
90
+ &:active,
91
+ &[disabled],
92
+ fieldset[disabled] & {
93
+ background-color: transparent;
94
+ .box-shadow(none);
180
95
  }
181
-
182
- // IE7 has some default padding on button controls
183
- *padding-top: 3px;
184
- *padding-bottom: 3px;
185
-
186
- &.btn-large {
187
- *padding-top: 7px;
188
- *padding-bottom: 7px;
96
+ &,
97
+ &:hover,
98
+ &:focus,
99
+ &:active {
100
+ border-color: transparent;
189
101
  }
190
- &.btn-small {
191
- *padding-top: 3px;
192
- *padding-bottom: 3px;
102
+ &:hover,
103
+ &:focus {
104
+ color: @link-hover-color;
105
+ text-decoration: underline;
106
+ background-color: transparent;
193
107
  }
194
- &.btn-mini {
195
- *padding-top: 1px;
196
- *padding-bottom: 1px;
108
+ &[disabled],
109
+ fieldset[disabled] & {
110
+ &:hover,
111
+ &:focus {
112
+ color: @gray-dark;
113
+ text-decoration: none;
114
+ }
197
115
  }
198
116
  }
199
117
 
200
118
 
201
- // Link buttons
119
+ // Button Sizes
202
120
  // --------------------------------------------------
203
121
 
204
- // Make a button look and behave like a link
205
- .btn-link,
206
- .btn-link:active,
207
- .btn-link[disabled] {
208
- background-color: transparent;
209
- background-image: none;
210
- .box-shadow(none);
122
+ .btn-large {
123
+ padding: @padding-large-vertical @padding-large-horizontal;
124
+ font-size: @font-size-large;
125
+ border-radius: @border-radius-large;
211
126
  }
212
- .btn-link {
213
- border-color: transparent;
214
- cursor: pointer;
215
- color: @linkColor;
216
- .border-radius(0);
127
+ .btn-small {
128
+ padding: @padding-small-vertical @padding-small-horizontal;
129
+ font-size: @font-size-small;
130
+ line-height: 1.5; // ensure proper height of button next to small input
131
+ border-radius: @border-radius-small;
132
+ }
133
+
134
+
135
+ // Block button
136
+ // --------------------------------------------------
137
+
138
+ .btn-block {
139
+ display: block;
140
+ width: 100%;
141
+ padding-left: 0;
142
+ padding-right: 0;
217
143
  }
218
- .btn-link:hover,
219
- .btn-link:focus {
220
- color: @linkColorHover;
221
- text-decoration: underline;
222
- background-color: transparent;
144
+
145
+ // Vertically space out multiple block buttons
146
+ .btn-block + .btn-block {
147
+ margin-top: 5px;
223
148
  }
224
- .btn-link[disabled]:hover,
225
- .btn-link[disabled]:focus {
226
- color: @grayDark;
227
- text-decoration: none;
149
+
150
+ // Specificity overrides
151
+ input[type="submit"],
152
+ input[type="reset"],
153
+ input[type="button"] {
154
+ &.btn-block {
155
+ width: 100%;
156
+ }
228
157
  }
@@ -3,19 +3,15 @@
3
3
  // --------------------------------------------------
4
4
 
5
5
 
6
+ // Wrapper for the slide container and indicators
6
7
  .carousel {
7
8
  position: relative;
8
- margin-bottom: @baseLineHeight;
9
- line-height: 1;
10
9
  }
11
10
 
12
11
  .carousel-inner {
12
+ position: relative;
13
13
  overflow: hidden;
14
14
  width: 100%;
15
- position: relative;
16
- }
17
-
18
- .carousel-inner {
19
15
 
20
16
  > .item {
21
17
  display: none;
@@ -25,7 +21,7 @@
25
21
  // Account for jankitude on images
26
22
  > img,
27
23
  > a > img {
28
- display: block;
24
+ .img-responsive();
29
25
  line-height: 1;
30
26
  }
31
27
  }
@@ -70,89 +66,140 @@
70
66
 
71
67
  .carousel-control {
72
68
  position: absolute;
73
- top: 40%;
74
- left: 15px;
75
- width: 40px;
76
- height: 40px;
77
- margin-top: -20px;
78
- font-size: 60px;
79
- font-weight: 100;
80
- line-height: 30px;
81
- color: @white;
69
+ top: 0;
70
+ left: 0;
71
+ bottom: 0;
72
+ width: 15%;
73
+ .opacity(.5);
74
+ font-size: 20px;
75
+ color: @carousel-control-color;
82
76
  text-align: center;
83
- background: @grayDarker;
84
- border: 3px solid @white;
85
- .border-radius(23px);
86
- .opacity(50);
87
-
88
- // we can't have this transition here
89
- // because webkit cancels the carousel
90
- // animation if you trip this while
91
- // in the middle of another animation
92
- // ;_;
93
- // .transition(opacity .2s linear);
94
-
95
- // Reposition the right one
77
+ text-shadow: @carousel-text-shadow;
78
+ // We can't have this transition here because webkit cancels the carousel
79
+ // animation if you trip this while in the middle of another animation.
80
+
81
+ // Set gradients for backgrounds
82
+ &.left {
83
+ #gradient > .horizontal(@start-color: rgba(0,0,0,.5); @end-color: rgba(0,0,0,.0001));
84
+ background-color: transparent;
85
+ }
96
86
  &.right {
97
87
  left: auto;
98
- right: 15px;
88
+ right: 0;
89
+ #gradient > .horizontal(@start-color: rgba(0,0,0,.0001); @end-color: rgba(0,0,0,.5));
90
+ background-color: transparent;
99
91
  }
100
92
 
101
93
  // Hover/focus state
102
94
  &:hover,
103
95
  &:focus {
104
- color: @white;
96
+ color: @carousel-control-color;
105
97
  text-decoration: none;
106
- .opacity(90);
98
+ .opacity(.9);
99
+ }
100
+
101
+ // Toggles
102
+ .glyphicon,
103
+ .icon-prev,
104
+ .icon-next {
105
+ position: absolute;
106
+ top: 50%;
107
+ left: 50%;
108
+ z-index: 5;
109
+ display: inline-block;
110
+ width: 20px;
111
+ height: 20px;
112
+ margin-top: -10px;
113
+ margin-left: -10px;
114
+ font-family: serif;
115
+ }
116
+ // Non-glyphicon toggles
117
+ .icon-prev {
118
+ &:before {
119
+ content: '\2039';// SINGLE LEFT-POINTING ANGLE QUOTATION MARK (U+2039)
120
+ }
121
+ }
122
+ .icon-next {
123
+ &:before {
124
+ content: '\203a';// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK (U+203A)
125
+ }
107
126
  }
108
127
  }
109
128
 
110
- // Carousel indicator pips
129
+ // Optional indicator pips
111
130
  // -----------------------------
112
131
  .carousel-indicators {
113
132
  position: absolute;
114
- top: 15px;
115
- right: 15px;
116
- z-index: 5;
117
- margin: 0;
133
+ bottom: 10px;
134
+ left: 50%;
135
+ z-index: 15;
136
+ width: 120px;
137
+ margin-left: -60px;
138
+ padding-left: 0;
118
139
  list-style: none;
140
+ text-align: center;
119
141
 
120
142
  li {
121
- display: block;
122
- float: left;
123
- width: 10px;
143
+ display: inline-block;
144
+ width: 10px;
124
145
  height: 10px;
125
- margin-left: 5px;
146
+ margin: 1px;
126
147
  text-indent: -999px;
127
- background-color: #ccc;
128
- background-color: rgba(255,255,255,.25);
129
- border-radius: 5px;
148
+ border: 1px solid @carousel-indicator-border-color;
149
+ border-radius: 10px;
150
+ cursor: pointer;
130
151
  }
131
152
  .active {
132
- background-color: #fff;
153
+ margin: 0;
154
+ width: 12px;
155
+ height: 12px;
156
+ background-color: @carousel-indicator-active-bg;
133
157
  }
134
158
  }
135
159
 
136
- // Caption for text below images
160
+ // Optional captions
137
161
  // -----------------------------
138
-
162
+ // Hidden by default for smaller viewports
139
163
  .carousel-caption {
140
164
  position: absolute;
141
- left: 0;
142
- right: 0;
143
- bottom: 0;
144
- padding: 15px;
145
- background: @grayDark;
146
- background: rgba(0,0,0,.75);
147
- }
148
- .carousel-caption h4,
149
- .carousel-caption p {
150
- color: @white;
151
- line-height: @baseLineHeight;
152
- }
153
- .carousel-caption h4 {
154
- margin: 0 0 5px;
165
+ left: 15%;
166
+ right: 15%;
167
+ bottom: 20px;
168
+ z-index: 10;
169
+ padding-top: 20px;
170
+ padding-bottom: 20px;
171
+ color: @carousel-caption-color;
172
+ text-align: center;
173
+ text-shadow: @carousel-text-shadow;
174
+ & .btn {
175
+ text-shadow: none; // No shadow for button elements in carousel-caption
176
+ }
155
177
  }
156
- .carousel-caption p {
157
- margin-bottom: 0;
178
+
179
+
180
+ // Scale up controls for tablets and up
181
+ @media screen and (min-width: @screen-tablet) {
182
+
183
+ // Scale up the controls a smidge
184
+ .carousel-control .glyphicon,
185
+ .carousel-control .icon-prev,
186
+ .carousel-control .icon-next {
187
+ width: 30px;
188
+ height: 30px;
189
+ margin-top: -15px;
190
+ margin-left: -15px;
191
+ font-size: 30px;
192
+ }
193
+
194
+ // Show and left align the captions
195
+ .carousel-caption {
196
+ left: 20%;
197
+ right: 20%;
198
+ padding-bottom: 30px;
199
+ }
200
+
201
+ // Move up the indicators
202
+ .carousel-indicators {
203
+ bottom: 20px;
204
+ }
158
205
  }