twitter-bootstrap-rails 1.4.3 → 2.0rc0

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 (72) hide show
  1. data/README.md +85 -52
  2. data/lib/generators/bootstrap/install/templates/bootstrap.coffee +15 -12
  3. data/lib/generators/bootstrap/layout/layout_generator.rb +1 -1
  4. data/lib/generators/bootstrap/layout/templates/layout.html.erb +97 -50
  5. data/lib/generators/bootstrap/layout/templates/layout.html.slim +40 -0
  6. data/lib/generators/bootstrap/themed/templates/_form.html.erb +5 -1
  7. data/lib/generators/bootstrap/themed/templates/edit.html.erb +2 -1
  8. data/lib/generators/bootstrap/themed/templates/index.html.erb +1 -0
  9. data/lib/generators/bootstrap/themed/templates/new.html.erb +1 -1
  10. data/lib/generators/bootstrap/themed/templates/show.html.erb +7 -3
  11. data/lib/generators/bootstrap/themed/themed_generator.rb +0 -15
  12. data/lib/twitter-bootstrap-rails.rb +3 -3
  13. data/lib/twitter/bootstrap/rails/bootstrap.rb +1 -1
  14. data/lib/twitter/bootstrap/rails/version.rb +1 -1
  15. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  16. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  17. data/vendor/assets/javascripts/twitter/bootstrap.js +10 -6
  18. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +91 -0
  19. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-button.js +98 -0
  20. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +154 -0
  21. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +136 -0
  22. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +58 -21
  23. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +63 -114
  24. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +38 -33
  25. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +62 -44
  26. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +130 -0
  27. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +270 -0
  28. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +51 -0
  29. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +271 -0
  30. data/vendor/toolkit/twitter/bootstrap/accordion.less +28 -0
  31. data/vendor/toolkit/twitter/bootstrap/alerts.less +70 -0
  32. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +41 -5
  33. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +22 -0
  34. data/vendor/toolkit/twitter/bootstrap/button-groups.less +147 -0
  35. data/vendor/toolkit/twitter/bootstrap/buttons.less +165 -0
  36. data/vendor/toolkit/twitter/bootstrap/carousel.less +121 -0
  37. data/vendor/toolkit/twitter/bootstrap/close.less +18 -0
  38. data/vendor/toolkit/twitter/bootstrap/code.less +44 -0
  39. data/vendor/toolkit/twitter/bootstrap/component-animations.less +18 -0
  40. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +131 -0
  41. data/vendor/toolkit/twitter/bootstrap/forms.less +335 -299
  42. data/vendor/toolkit/twitter/bootstrap/grid.less +8 -0
  43. data/vendor/toolkit/twitter/bootstrap/hero-unit.less +20 -0
  44. data/vendor/toolkit/twitter/bootstrap/labels.less +16 -0
  45. data/vendor/toolkit/twitter/bootstrap/layouts.less +17 -0
  46. data/vendor/toolkit/twitter/bootstrap/mixins.less +391 -76
  47. data/vendor/toolkit/twitter/bootstrap/modals.less +72 -0
  48. data/vendor/toolkit/twitter/bootstrap/navbar.less +292 -0
  49. data/vendor/toolkit/twitter/bootstrap/navs.less +344 -0
  50. data/vendor/toolkit/twitter/bootstrap/pager.less +30 -0
  51. data/vendor/toolkit/twitter/bootstrap/pagination.less +55 -0
  52. data/vendor/toolkit/twitter/bootstrap/popovers.less +49 -0
  53. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +95 -0
  54. data/vendor/toolkit/twitter/bootstrap/reset.less +37 -52
  55. data/vendor/toolkit/twitter/bootstrap/responsive.less +323 -0
  56. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +13 -123
  57. data/vendor/toolkit/twitter/bootstrap/sprites.less +156 -0
  58. data/vendor/toolkit/twitter/bootstrap/tables.less +75 -160
  59. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +35 -0
  60. data/vendor/toolkit/twitter/bootstrap/tooltip.less +35 -0
  61. data/vendor/toolkit/twitter/bootstrap/type.less +100 -70
  62. data/vendor/toolkit/twitter/bootstrap/utilities.less +23 -0
  63. data/vendor/toolkit/twitter/bootstrap/variables.less +94 -55
  64. data/vendor/toolkit/twitter/bootstrap/wells.less +17 -0
  65. metadata +58 -49
  66. data/lib/generators/bootstrap/themed/templates/builders/builder.rb +0 -24
  67. data/lib/generators/bootstrap/themed/templates/builders/helper.rb +0 -6
  68. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alerts.js +0 -124
  69. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-buttons.js +0 -64
  70. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tabs.js +0 -80
  71. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-twipsy.js +0 -321
  72. data/vendor/toolkit/twitter/bootstrap/patterns.less +0 -1063
@@ -0,0 +1,8 @@
1
+ // GRID SYSTEM
2
+ // -----------
3
+
4
+ // Fixed (940px)
5
+ #gridSystem > .generate(@gridColumns, @gridColumnWidth, @gridGutterWidth);
6
+
7
+ // Fluid (940px)
8
+ #fluidGridSystem > .generate(@gridColumns, @fluidGridColumnWidth, @fluidGridGutterWidth);
@@ -0,0 +1,20 @@
1
+ // HERO UNIT
2
+ // ---------
3
+
4
+ .hero-unit {
5
+ padding: 60px;
6
+ margin-bottom: 30px;
7
+ background-color: #f5f5f5;
8
+ .border-radius(6px);
9
+ h1 {
10
+ margin-bottom: 0;
11
+ font-size: 60px;
12
+ line-height: 1;
13
+ letter-spacing: -1px;
14
+ }
15
+ p {
16
+ font-size: 18px;
17
+ font-weight: 200;
18
+ line-height: @baseLineHeight * 1.5;
19
+ }
20
+ }
@@ -0,0 +1,16 @@
1
+ // LABELS
2
+ // ------
3
+
4
+ .label {
5
+ padding: 1px 3px 2px;
6
+ font-size: @baseFontSize * .75;
7
+ font-weight: bold;
8
+ color: @white;
9
+ text-transform: uppercase;
10
+ background-color: @grayLight;
11
+ .border-radius(3px);
12
+ }
13
+ .label-important { background-color: @errorText; }
14
+ .label-warning { background-color: @orange; }
15
+ .label-success { background-color: @successText; }
16
+ .label-info { background-color: @infoText; }
@@ -0,0 +1,17 @@
1
+ //
2
+ // Layouts
3
+ // Fixed-width and fluid (with sidebar) layouts
4
+ // --------------------------------------------
5
+
6
+
7
+ // Container (centered, fixed-width layouts)
8
+ .container {
9
+ .container-fixed();
10
+ }
11
+
12
+ // Fluid layouts (left aligned, with sidebar, min- & max-width content)
13
+ .container-fluid {
14
+ padding-left: @gridGutterWidth;
15
+ padding-right: @gridGutterWidth;
16
+ .clearfix();
17
+ }
@@ -1,40 +1,86 @@
1
- /* Mixins.less
2
- * Snippets of reusable CSS to develop faster and keep code readable
3
- * ----------------------------------------------------------------- */
1
+ // Mixins.less
2
+ // Snippets of reusable CSS to develop faster and keep code readable
3
+ // -----------------------------------------------------------------
4
4
 
5
5
 
6
- // Clearfix for clearing floats like a boss h5bp.com/q
6
+ // UTILITY MIXINS
7
+ // --------------------------------------------------
8
+
9
+ // Clearfix
10
+ // --------
11
+ // For clearing floats like a boss h5bp.com/q
7
12
  .clearfix() {
8
- zoom: 1;
13
+ *zoom: 1;
9
14
  &:before,
10
15
  &:after {
11
16
  display: table;
12
17
  content: "";
13
- zoom: 1;
14
18
  }
15
19
  &:after {
16
20
  clear: both;
17
21
  }
18
22
  }
19
23
 
24
+ // Webkit-style focus
25
+ // ------------------
26
+ .tab-focus() {
27
+ // Default
28
+ outline: thin dotted;
29
+ // Webkit
30
+ outline: 5px auto -webkit-focus-ring-color;
31
+ outline-offset: -2px;
32
+ }
33
+
20
34
  // Center-align a block level element
35
+ // ----------------------------------
21
36
  .center-block() {
22
37
  display: block;
23
38
  margin-left: auto;
24
39
  margin-right: auto;
25
40
  }
26
41
 
42
+ // IE7 inline-block
43
+ // ----------------
44
+ .ie7-inline-block() {
45
+ *display: inline; /* IE7 inline-block hack */
46
+ *zoom: 1;
47
+ }
48
+
49
+ // IE7 likes to collapse whitespace on either side of the inline-block elements.
50
+ // Ems because we're attempting to match the width of a space character. Left
51
+ // version is for form buttons, which typically come after other elements, and
52
+ // right version is for icons, which come before. Applying both is ok, but it will
53
+ // mean that space between those elements will be .6em (~2 space characters) in IE7,
54
+ // instead of the 1 space in other browsers.
55
+ .ie7-restore-left-whitespace() {
56
+ *margin-left: .3em;
57
+
58
+ &:first-child {
59
+ *margin-left: 0;
60
+ }
61
+ }
62
+
63
+ .ie7-restore-right-whitespace() {
64
+ *margin-right: .3em;
65
+
66
+ &:last-child {
67
+ *margin-left: 0;
68
+ }
69
+ }
70
+
27
71
  // Sizing shortcuts
72
+ // -------------------------
28
73
  .size(@height: 5px, @width: 5px) {
29
- height: @height;
30
74
  width: @width;
75
+ height: @height;
31
76
  }
32
77
  .square(@size: 5px) {
33
78
  .size(@size, @size);
34
79
  }
35
80
 
36
- // Input placeholder text
37
- .placeholder(@color: @grayLight) {
81
+ // Placeholder text
82
+ // -------------------------
83
+ .placeholder(@color: @placeholderText) {
38
84
  :-moz-placeholder {
39
85
  color: @color;
40
86
  }
@@ -43,58 +89,185 @@
43
89
  }
44
90
  }
45
91
 
46
- // Font Stacks
92
+
93
+
94
+ // FONTS
95
+ // --------------------------------------------------
96
+
47
97
  #font {
48
- .shorthand(@weight: normal, @size: 14px, @lineHeight: 20px) {
49
- font-size: @size;
50
- font-weight: @weight;
51
- line-height: @lineHeight;
98
+ #family {
99
+ .serif() {
100
+ font-family: Georgia, "Times New Roman", Times, serif;
101
+ }
102
+ .sans-serif() {
103
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
104
+ }
105
+ .monospace() {
106
+ font-family: Menlo, Monaco, "Courier New", monospace;
107
+ }
52
108
  }
53
- .sans-serif(@weight: normal, @size: 14px, @lineHeight: 20px) {
54
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
109
+ .shorthand(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
55
110
  font-size: @size;
56
111
  font-weight: @weight;
57
112
  line-height: @lineHeight;
58
113
  }
59
- .serif(@weight: normal, @size: 14px, @lineHeight: 20px) {
60
- font-family: "Georgia", Times New Roman, Times, serif;
61
- font-size: @size;
62
- font-weight: @weight;
63
- line-height: @lineHeight;
114
+ .serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
115
+ #font > #family > .serif;
116
+ #font > .shorthand(@size, @weight, @lineHeight);
64
117
  }
65
- .monospace(@weight: normal, @size: 12px, @lineHeight: 20px) {
66
- font-family: "Monaco", Courier New, monospace;
67
- font-size: @size;
68
- font-weight: @weight;
69
- line-height: @lineHeight;
118
+ .sans-serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
119
+ #font > #family > .sans-serif;
120
+ #font > .shorthand(@size, @weight, @lineHeight);
121
+ }
122
+ .monospace(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
123
+ #font > #family > .monospace;
124
+ #font > .shorthand(@size, @weight, @lineHeight);
70
125
  }
71
126
  }
72
127
 
73
- // Grid System
74
- .fixed-container() {
75
- width: @siteWidth;
128
+
129
+
130
+ // GRID SYSTEM
131
+ // --------------------------------------------------
132
+
133
+ // Site container
134
+ // -------------------------
135
+ .container-fixed() {
136
+ width: @gridRowWidth;
76
137
  margin-left: auto;
77
138
  margin-right: auto;
78
139
  .clearfix();
79
140
  }
80
- .columns(@columnSpan: 1) {
81
- width: (@gridColumnWidth * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1));
82
- }
83
- .offset(@columnOffset: 1) {
84
- margin-left: (@gridColumnWidth * @columnOffset) + (@gridGutterWidth * (@columnOffset - 1)) + @extraSpace;
141
+
142
+ // Le grid system
143
+ // -------------------------
144
+ #gridSystem {
145
+ // Setup the mixins to be used
146
+ .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, @columns) {
147
+ width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
148
+ }
149
+ .offset(@gridColumnWidth, @gridGutterWidth, @columns) {
150
+ margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1)) + (@gridGutterWidth * 2);
151
+ }
152
+ .gridColumn(@gridGutterWidth) {
153
+ float: left;
154
+ margin-left: @gridGutterWidth;
155
+ }
156
+ // Take these values and mixins, and make 'em do their thang
157
+ .generate(@gridColumns, @gridColumnWidth, @gridGutterWidth) {
158
+ // Row surrounds the columns
159
+ .row {
160
+ margin-left: @gridGutterWidth * -1;
161
+ .clearfix();
162
+ }
163
+ // Find all .span# classes within .row and give them the necessary properties for grid columns (supported by all browsers back to IE7, thanks @dhg)
164
+ [class*="span"] {
165
+ #gridSystem > .gridColumn(@gridGutterWidth);
166
+ }
167
+ // Default columns
168
+ .span1 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 1); }
169
+ .span2 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 2); }
170
+ .span3 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 3); }
171
+ .span4 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 4); }
172
+ .span5 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 5); }
173
+ .span6 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 6); }
174
+ .span7 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 7); }
175
+ .span8 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 8); }
176
+ .span9 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 9); }
177
+ .span10 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 10); }
178
+ .span11 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 11); }
179
+ .span12,
180
+ .container { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 12); }
181
+ // Offset column options
182
+ .offset1 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 1); }
183
+ .offset2 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 2); }
184
+ .offset3 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 3); }
185
+ .offset4 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 4); }
186
+ .offset5 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 5); }
187
+ .offset6 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 6); }
188
+ .offset7 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 7); }
189
+ .offset8 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 8); }
190
+ .offset9 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 9); }
191
+ .offset10 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 10); }
192
+ .offset11 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 11); }
193
+ }
85
194
  }
86
- // Necessary grid styles for every column to make them appear next to each other horizontally
87
- .gridColumn() {
88
- display: inline;
89
- float: left;
90
- margin-left: @gridGutterWidth;
195
+
196
+ // Fluid grid system
197
+ // -------------------------
198
+ #fluidGridSystem {
199
+ // Setup the mixins to be used
200
+ .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, @columns) {
201
+ width: 1% * (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1));
202
+ }
203
+ .gridColumn(@fluidGridGutterWidth) {
204
+ float: left;
205
+ margin-left: @fluidGridGutterWidth;
206
+ }
207
+ // Take these values and mixins, and make 'em do their thang
208
+ .generate(@gridColumns, @fluidGridColumnWidth, @fluidGridGutterWidth) {
209
+ // Row surrounds the columns
210
+ .row-fluid {
211
+ width: 100%;
212
+ .clearfix();
213
+
214
+ // Find all .span# classes within .row and give them the necessary properties for grid columns (supported by all browsers back to IE7, thanks @dhg)
215
+ > [class*="span"] {
216
+ #fluidGridSystem > .gridColumn(@fluidGridGutterWidth);
217
+ }
218
+ > [class*="span"]:first-child {
219
+ margin-left: 0;
220
+ }
221
+ // Default columns
222
+ .span1 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 1); }
223
+ .span2 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 2); }
224
+ .span3 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 3); }
225
+ .span4 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 4); }
226
+ .span5 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 5); }
227
+ .span6 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 6); }
228
+ .span7 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 7); }
229
+ .span8 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 8); }
230
+ .span9 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 9); }
231
+ .span10 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 10); }
232
+ .span11 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 11); }
233
+ .span12 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 12); }
234
+ }
235
+ }
91
236
  }
92
- // makeColumn can be used to mark any element (e.g., .content-primary) as a column without changing markup to .span something
93
- .makeColumn(@columnSpan: 1) {
94
- .gridColumn();
95
- .columns(@columnSpan);
237
+
238
+
239
+
240
+ // Input grid system
241
+ // -------------------------
242
+ #inputGridSystem {
243
+ .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, @columns) {
244
+ width: ((@gridColumnWidth) * @columns) + (@gridGutterWidth * (@columns - 1)) - 10;
245
+ }
246
+ .generate(@gridColumns, @gridColumnWidth, @gridGutterWidth) {
247
+ input,
248
+ textarea,
249
+ .uneditable-input {
250
+ &.span1 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 1); }
251
+ &.span2 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 2); }
252
+ &.span3 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 3); }
253
+ &.span4 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 4); }
254
+ &.span5 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 5); }
255
+ &.span6 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 6); }
256
+ &.span7 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 7); }
257
+ &.span8 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 8); }
258
+ &.span9 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 9); }
259
+ &.span10 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 10); }
260
+ &.span11 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 11); }
261
+ &.span12 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 12); }
262
+ }
263
+ }
96
264
  }
97
265
 
266
+
267
+
268
+ // CSS3 PROPERTIES
269
+ // --------------------------------------------------
270
+
98
271
  // Border Radius
99
272
  .border-radius(@radius: 5px) {
100
273
  -webkit-border-radius: @radius;
@@ -111,22 +284,91 @@
111
284
 
112
285
  // Transitions
113
286
  .transition(@transition) {
114
- -webkit-transition: @transition;
115
- -moz-transition: @transition;
116
- -ms-transition: @transition;
117
- -o-transition: @transition;
118
- transition: @transition;
287
+ -webkit-transition: @transition;
288
+ -moz-transition: @transition;
289
+ -ms-transition: @transition;
290
+ -o-transition: @transition;
291
+ transition: @transition;
292
+ }
293
+
294
+ // Transformations
295
+ .rotate(@degrees) {
296
+ -webkit-transform: rotate(@degrees);
297
+ -moz-transform: rotate(@degrees);
298
+ -ms-transform: rotate(@degrees);
299
+ -o-transform: rotate(@degrees);
300
+ transform: rotate(@degrees);
301
+ }
302
+ .scale(@ratio) {
303
+ -webkit-transform: scale(@ratio);
304
+ -moz-transform: scale(@ratio);
305
+ -ms-transform: scale(@ratio);
306
+ -o-transform: scale(@ratio);
307
+ transform: scale(@ratio);
308
+ }
309
+ .translate(@x: 0, @y: 0) {
310
+ -webkit-transform: translate(@x, @y);
311
+ -moz-transform: translate(@x, @y);
312
+ -ms-transform: translate(@x, @y);
313
+ -o-transform: translate(@x, @y);
314
+ transform: translate(@x, @y);
315
+ }
316
+ .skew(@x: 0, @y: 0) {
317
+ -webkit-transform: translate(@x, @y);
318
+ -moz-transform: translate(@x, @y);
319
+ -ms-transform: translate(@x, @y);
320
+ -o-transform: translate(@x, @y);
321
+ transform: translate(@x, @y);
322
+ }
323
+ .skew(@x: 0, @y: 0) {
324
+ -webkit-transform: skew(@x, @y);
325
+ -moz-transform: skew(@x, @y);
326
+ -ms-transform: skew(@x, @y);
327
+ -o-transform: skew(@x, @y);
328
+ transform: skew(@x, @y);
119
329
  }
120
330
 
121
331
  // Background clipping
332
+ // Heads up: FF 3.6 and under need "padding" instead of "padding-box"
122
333
  .background-clip(@clip) {
123
334
  -webkit-background-clip: @clip;
124
335
  -moz-background-clip: @clip;
125
336
  background-clip: @clip;
126
337
  }
127
338
 
339
+ // Background sizing
340
+ .background-size(@size){
341
+ -webkit-background-size: @size;
342
+ -moz-background-size: @size;
343
+ -o-background-size: @size;
344
+ background-size: @size;
345
+ }
346
+
347
+
348
+ // Box sizing
349
+ .box-sizing(@boxmodel) {
350
+ -webkit-box-sizing: @boxmodel;
351
+ -moz-box-sizing: @boxmodel;
352
+ box-sizing: @boxmodel;
353
+ }
354
+
355
+ // User select
356
+ // For selecting text on the page
357
+ .user-select(@select) {
358
+ -webkit-user-select: @select;
359
+ -moz-user-select: @select;
360
+ -o-user-select: @select;
361
+ user-select: @select;
362
+ }
363
+
364
+ // Resize anything
365
+ .resizable(@direction: both) {
366
+ resize: @direction; // Options: horizontal, vertical, both
367
+ overflow: auto; // Safari fix
368
+ }
369
+
128
370
  // CSS3 Content Columns
129
- .content-columns(@columnCount, @columnGap: 20px) {
371
+ .content-columns(@columnCount, @columnGap: @gridColumnGutter) {
130
372
  -webkit-column-count: @columnCount;
131
373
  -moz-column-count: @columnCount;
132
374
  column-count: @columnCount;
@@ -135,12 +377,17 @@
135
377
  column-gap: @columnGap;
136
378
  }
137
379
 
138
- // Make any element resizable for prototyping
139
- .resizable(@direction: both) {
140
- resize: @direction; // Options are horizontal, vertical, both
141
- overflow: auto; // Safari fix
380
+ // Opacity
381
+ .opacity(@opacity: 100) {
382
+ opacity: @opacity / 100;
383
+ filter: e(%("alpha(opacity=%d)", @opacity));
142
384
  }
143
385
 
386
+
387
+
388
+ // BACKGROUNDS
389
+ // --------------------------------------------------
390
+
144
391
  // Add an alphatransparency value to any background or border color (via Elyse Holladay)
145
392
  #translucent {
146
393
  .background(@color: @white, @alpha: 1) {
@@ -148,45 +395,42 @@
148
395
  }
149
396
  .border(@color: @white, @alpha: 1) {
150
397
  border-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
151
- background-clip: padding-box;
398
+ .background-clip(padding-box);
152
399
  }
153
400
  }
154
401
 
155
- // Gradient Bar Colors for buttons and allerts
402
+ // Gradient Bar Colors for buttons and alerts
156
403
  .gradientBar(@primaryColor, @secondaryColor) {
157
404
  #gradient > .vertical(@primaryColor, @secondaryColor);
158
- text-shadow: 0 -1px 0 rgba(0,0,0,.25);
159
405
  border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%);
160
406
  border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
161
407
  }
162
408
 
163
409
  // Gradients
164
410
  #gradient {
165
- .horizontal (@startColor: #555, @endColor: #333) {
411
+ .horizontal(@startColor: #555, @endColor: #333) {
166
412
  background-color: @endColor;
167
- background-repeat: repeat-x;
168
- background-image: -khtml-gradient(linear, left top, right top, from(@startColor), to(@endColor)); // Konqueror
169
413
  background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+
170
414
  background-image: -ms-linear-gradient(left, @startColor, @endColor); // IE10
171
- background-image: -webkit-gradient(linear, left top, right top, color-stop(0%, @startColor), color-stop(100%, @endColor)); // Safari 4+, Chrome 2+
415
+ background-image: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
172
416
  background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+
173
417
  background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10
174
418
  background-image: linear-gradient(left, @startColor, @endColor); // Le standard
419
+ background-repeat: repeat-x;
175
420
  filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",@startColor,@endColor)); // IE9 and down
176
421
  }
177
- .vertical (@startColor: #555, @endColor: #333) {
178
- background-color: @endColor;
179
- background-repeat: repeat-x;
180
- background-image: -khtml-gradient(linear, left top, left bottom, from(@startColor), to(@endColor)); // Konqueror
422
+ .vertical(@startColor: #555, @endColor: #333) {
423
+ background-color: mix(@startColor, @endColor, 60%);
181
424
  background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
182
425
  background-image: -ms-linear-gradient(top, @startColor, @endColor); // IE10
183
- background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, @startColor), color-stop(100%, @endColor)); // Safari 4+, Chrome 2+
426
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
184
427
  background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
185
428
  background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
186
429
  background-image: linear-gradient(top, @startColor, @endColor); // The standard
430
+ background-repeat: repeat-x;
187
431
  filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@startColor,@endColor)); // IE9 and down
188
432
  }
189
- .directional (@startColor: #555, @endColor: #333, @deg: 45deg) {
433
+ .directional(@startColor: #555, @endColor: #333, @deg: 45deg) {
190
434
  background-color: @endColor;
191
435
  background-repeat: repeat-x;
192
436
  background-image: -moz-linear-gradient(@deg, @startColor, @endColor); // FF 3.6+
@@ -196,27 +440,98 @@
196
440
  background-image: linear-gradient(@deg, @startColor, @endColor); // The standard
197
441
  }
198
442
  .vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
199
- background-color: @endColor;
200
- background-repeat: no-repeat;
443
+ background-color: mix(@midColor, @endColor, 80%);
201
444
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
202
445
  background-image: -webkit-linear-gradient(@startColor, @midColor @colorStop, @endColor);
203
446
  background-image: -moz-linear-gradient(top, @startColor, @midColor @colorStop, @endColor);
204
447
  background-image: -ms-linear-gradient(@startColor, @midColor @colorStop, @endColor);
205
448
  background-image: -o-linear-gradient(@startColor, @midColor @colorStop, @endColor);
206
449
  background-image: linear-gradient(@startColor, @midColor @colorStop, @endColor);
450
+ background-repeat: no-repeat;
207
451
  filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@startColor,@endColor)); // IE9 and down, gets no color-stop at all for proper fallback
208
452
  }
453
+ .radial(@innerColor: #555, @outerColor: #333) {
454
+ background-color: @outerColor;
455
+ background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@innerColor), to(@outerColor));
456
+ background-image: -webkit-radial-gradient(circle, @innerColor, @outerColor);
457
+ background-image: -moz-radial-gradient(circle, @innerColor, @outerColor);
458
+ background-image: -ms-radial-gradient(circle, @innerColor, @outerColor);
459
+ background-repeat: no-repeat;
460
+ // Opera cannot do radial gradients yet
461
+ }
462
+ .striped(@color, @angle: -45deg) {
463
+ background-color: @color;
464
+ background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
465
+ background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
466
+ background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
467
+ background-image: -ms-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
468
+ background-image: -o-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
469
+ background-image: linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
470
+ }
209
471
  }
210
-
211
472
  // Reset filters for IE
212
473
  .reset-filter() {
213
474
  filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
214
475
  }
215
476
 
216
- // Opacity
217
- .opacity(@opacity: 100) {
218
- filter: e(%("alpha(opacity=%d)", @opacity));
219
- -khtml-opacity: @opacity / 100;
220
- -moz-opacity: @opacity / 100;
221
- opacity: @opacity / 100;
222
- }
477
+
478
+ // Mixin for generating button backgrounds
479
+ // ---------------------------------------
480
+ .buttonBackground(@startColor, @endColor) {
481
+ // gradientBar will set the background to a pleasing blend of these, to support IE<=9
482
+ .gradientBar(@startColor, @endColor);
483
+ .reset-filter();
484
+
485
+ // in these cases the gradient won't cover the background, so we override
486
+ &:hover, &:active, &.active, &.disabled, &[disabled] {
487
+ background-color: @endColor;
488
+ }
489
+
490
+ // IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
491
+ &:active,
492
+ &.active {
493
+ background-color: darken(@endColor, 10%) e("\9");
494
+ }
495
+ }
496
+
497
+
498
+ // COMPONENT MIXINS
499
+ // --------------------------------------------------
500
+
501
+ // POPOVER ARROWS
502
+ // -------------------------
503
+ // For tipsies and popovers
504
+ #popoverArrow {
505
+ .top(@arrowWidth: 5px) {
506
+ bottom: 0;
507
+ left: 50%;
508
+ margin-left: -@arrowWidth;
509
+ border-left: @arrowWidth solid transparent;
510
+ border-right: @arrowWidth solid transparent;
511
+ border-top: @arrowWidth solid @black;
512
+ }
513
+ .left(@arrowWidth: 5px) {
514
+ top: 50%;
515
+ right: 0;
516
+ margin-top: -@arrowWidth;
517
+ border-top: @arrowWidth solid transparent;
518
+ border-bottom: @arrowWidth solid transparent;
519
+ border-left: @arrowWidth solid @black;
520
+ }
521
+ .bottom(@arrowWidth: 5px) {
522
+ top: 0;
523
+ left: 50%;
524
+ margin-left: -@arrowWidth;
525
+ border-left: @arrowWidth solid transparent;
526
+ border-right: @arrowWidth solid transparent;
527
+ border-bottom: @arrowWidth solid @black;
528
+ }
529
+ .right(@arrowWidth: 5px) {
530
+ top: 50%;
531
+ left: 0;
532
+ margin-top: -@arrowWidth;
533
+ border-top: @arrowWidth solid transparent;
534
+ border-bottom: @arrowWidth solid transparent;
535
+ border-right: @arrowWidth solid @black;
536
+ }
537
+ }