bootstrap-generators 2.0.0 → 2.0.1

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