kickoff 0.0.2

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 (115) hide show
  1. data/.gitignore +4 -0
  2. data/.rspec +1 -0
  3. data/CHANGELOG +3 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE +20 -0
  6. data/README.md +41 -0
  7. data/Rakefile +5 -0
  8. data/features/nifty_authentication.feature +80 -0
  9. data/features/nifty_config.feature +17 -0
  10. data/features/nifty_layout.feature +20 -0
  11. data/features/nifty_scaffold.feature +80 -0
  12. data/features/step_definitions/common_steps.rb +62 -0
  13. data/features/step_definitions/rails_setup_steps.rb +6 -0
  14. data/features/support/env.rb +6 -0
  15. data/features/support/matchers.rb +7 -0
  16. data/kickoff.gemspec +24 -0
  17. data/lib/generators/kickoff/authentication/USAGE +50 -0
  18. data/lib/generators/kickoff/authentication/authentication_generator.rb +154 -0
  19. data/lib/generators/kickoff/authentication/templates/authlogic_session.rb +2 -0
  20. data/lib/generators/kickoff/authentication/templates/controller_authentication.rb +60 -0
  21. data/lib/generators/kickoff/authentication/templates/fixtures.yml +24 -0
  22. data/lib/generators/kickoff/authentication/templates/migration.rb +20 -0
  23. data/lib/generators/kickoff/authentication/templates/sessions_controller.rb +41 -0
  24. data/lib/generators/kickoff/authentication/templates/sessions_helper.rb +2 -0
  25. data/lib/generators/kickoff/authentication/templates/tests/rspec/sessions_controller.rb +39 -0
  26. data/lib/generators/kickoff/authentication/templates/tests/rspec/user.rb +83 -0
  27. data/lib/generators/kickoff/authentication/templates/tests/rspec/users_controller.rb +56 -0
  28. data/lib/generators/kickoff/authentication/templates/tests/shoulda/sessions_controller.rb +40 -0
  29. data/lib/generators/kickoff/authentication/templates/tests/shoulda/user.rb +85 -0
  30. data/lib/generators/kickoff/authentication/templates/tests/shoulda/users_controller.rb +61 -0
  31. data/lib/generators/kickoff/authentication/templates/tests/testunit/sessions_controller.rb +36 -0
  32. data/lib/generators/kickoff/authentication/templates/tests/testunit/user.rb +88 -0
  33. data/lib/generators/kickoff/authentication/templates/tests/testunit/users_controller.rb +53 -0
  34. data/lib/generators/kickoff/authentication/templates/user.rb +38 -0
  35. data/lib/generators/kickoff/authentication/templates/users_controller.rb +32 -0
  36. data/lib/generators/kickoff/authentication/templates/users_helper.rb +2 -0
  37. data/lib/generators/kickoff/authentication/templates/views/erb/_form.html.erb +20 -0
  38. data/lib/generators/kickoff/authentication/templates/views/erb/edit.html.erb +3 -0
  39. data/lib/generators/kickoff/authentication/templates/views/erb/login.html.erb +30 -0
  40. data/lib/generators/kickoff/authentication/templates/views/erb/signup.html.erb +5 -0
  41. data/lib/generators/kickoff/authentication/templates/views/haml/_form.html.haml +16 -0
  42. data/lib/generators/kickoff/authentication/templates/views/haml/edit.html.haml +3 -0
  43. data/lib/generators/kickoff/authentication/templates/views/haml/login.html.haml +26 -0
  44. data/lib/generators/kickoff/authentication/templates/views/haml/signup.html.haml +5 -0
  45. data/lib/generators/kickoff/layout/USAGE +25 -0
  46. data/lib/generators/kickoff/layout/layout_generator.rb +38 -0
  47. data/lib/generators/kickoff/layout/templates/_forms.scss +417 -0
  48. data/lib/generators/kickoff/layout/templates/_mixins.scss +211 -0
  49. data/lib/generators/kickoff/layout/templates/_patterns.scss +960 -0
  50. data/lib/generators/kickoff/layout/templates/_reset.scss +141 -0
  51. data/lib/generators/kickoff/layout/templates/_scaffolding.scss +137 -0
  52. data/lib/generators/kickoff/layout/templates/_tables.scss +172 -0
  53. data/lib/generators/kickoff/layout/templates/_type.scss +185 -0
  54. data/lib/generators/kickoff/layout/templates/_variables.scss +50 -0
  55. data/lib/generators/kickoff/layout/templates/application.scss +21 -0
  56. data/lib/generators/kickoff/layout/templates/error_messages_helper.rb +23 -0
  57. data/lib/generators/kickoff/layout/templates/layout.html.erb +34 -0
  58. data/lib/generators/kickoff/layout/templates/layout.html.haml +21 -0
  59. data/lib/generators/kickoff/layout/templates/layout_helper.rb +22 -0
  60. data/lib/generators/kickoff/layout/templates/stylesheet.sass +73 -0
  61. data/lib/generators/kickoff/scaffold/USAGE +51 -0
  62. data/lib/generators/kickoff/scaffold/scaffold_generator.rb +318 -0
  63. data/lib/generators/kickoff/scaffold/templates/actions/create.rb +8 -0
  64. data/lib/generators/kickoff/scaffold/templates/actions/destroy.rb +5 -0
  65. data/lib/generators/kickoff/scaffold/templates/actions/edit.rb +3 -0
  66. data/lib/generators/kickoff/scaffold/templates/actions/index.rb +3 -0
  67. data/lib/generators/kickoff/scaffold/templates/actions/new.rb +3 -0
  68. data/lib/generators/kickoff/scaffold/templates/actions/show.rb +3 -0
  69. data/lib/generators/kickoff/scaffold/templates/actions/update.rb +8 -0
  70. data/lib/generators/kickoff/scaffold/templates/controller.rb +3 -0
  71. data/lib/generators/kickoff/scaffold/templates/fixtures.yml +9 -0
  72. data/lib/generators/kickoff/scaffold/templates/helper.rb +2 -0
  73. data/lib/generators/kickoff/scaffold/templates/migration.rb +16 -0
  74. data/lib/generators/kickoff/scaffold/templates/model.rb +4 -0
  75. data/lib/generators/kickoff/scaffold/templates/tests/rspec/actions/create.rb +11 -0
  76. data/lib/generators/kickoff/scaffold/templates/tests/rspec/actions/destroy.rb +6 -0
  77. data/lib/generators/kickoff/scaffold/templates/tests/rspec/actions/edit.rb +4 -0
  78. data/lib/generators/kickoff/scaffold/templates/tests/rspec/actions/index.rb +4 -0
  79. data/lib/generators/kickoff/scaffold/templates/tests/rspec/actions/new.rb +4 -0
  80. data/lib/generators/kickoff/scaffold/templates/tests/rspec/actions/show.rb +4 -0
  81. data/lib/generators/kickoff/scaffold/templates/tests/rspec/actions/update.rb +11 -0
  82. data/lib/generators/kickoff/scaffold/templates/tests/rspec/controller.rb +8 -0
  83. data/lib/generators/kickoff/scaffold/templates/tests/rspec/model.rb +7 -0
  84. data/lib/generators/kickoff/scaffold/templates/tests/shoulda/actions/create.rb +13 -0
  85. data/lib/generators/kickoff/scaffold/templates/tests/shoulda/actions/destroy.rb +8 -0
  86. data/lib/generators/kickoff/scaffold/templates/tests/shoulda/actions/edit.rb +6 -0
  87. data/lib/generators/kickoff/scaffold/templates/tests/shoulda/actions/index.rb +6 -0
  88. data/lib/generators/kickoff/scaffold/templates/tests/shoulda/actions/new.rb +6 -0
  89. data/lib/generators/kickoff/scaffold/templates/tests/shoulda/actions/show.rb +6 -0
  90. data/lib/generators/kickoff/scaffold/templates/tests/shoulda/actions/update.rb +13 -0
  91. data/lib/generators/kickoff/scaffold/templates/tests/shoulda/controller.rb +5 -0
  92. data/lib/generators/kickoff/scaffold/templates/tests/shoulda/model.rb +7 -0
  93. data/lib/generators/kickoff/scaffold/templates/tests/testunit/actions/create.rb +11 -0
  94. data/lib/generators/kickoff/scaffold/templates/tests/testunit/actions/destroy.rb +6 -0
  95. data/lib/generators/kickoff/scaffold/templates/tests/testunit/actions/edit.rb +4 -0
  96. data/lib/generators/kickoff/scaffold/templates/tests/testunit/actions/index.rb +4 -0
  97. data/lib/generators/kickoff/scaffold/templates/tests/testunit/actions/new.rb +4 -0
  98. data/lib/generators/kickoff/scaffold/templates/tests/testunit/actions/show.rb +4 -0
  99. data/lib/generators/kickoff/scaffold/templates/tests/testunit/actions/update.rb +11 -0
  100. data/lib/generators/kickoff/scaffold/templates/tests/testunit/controller.rb +5 -0
  101. data/lib/generators/kickoff/scaffold/templates/tests/testunit/model.rb +7 -0
  102. data/lib/generators/kickoff/scaffold/templates/views/erb/_form.html.erb +10 -0
  103. data/lib/generators/kickoff/scaffold/templates/views/erb/edit.html.erb +14 -0
  104. data/lib/generators/kickoff/scaffold/templates/views/erb/index.html.erb +29 -0
  105. data/lib/generators/kickoff/scaffold/templates/views/erb/new.html.erb +7 -0
  106. data/lib/generators/kickoff/scaffold/templates/views/erb/show.html.erb +20 -0
  107. data/lib/generators/kickoff/scaffold/templates/views/haml/_form.html.haml +9 -0
  108. data/lib/generators/kickoff/scaffold/templates/views/haml/edit.html.haml +14 -0
  109. data/lib/generators/kickoff/scaffold/templates/views/haml/index.html.haml +25 -0
  110. data/lib/generators/kickoff/scaffold/templates/views/haml/new.html.haml +7 -0
  111. data/lib/generators/kickoff/scaffold/templates/views/haml/show.html.haml +20 -0
  112. data/lib/generators/kickoff/version.rb +3 -0
  113. data/lib/generators/kickoff.rb +29 -0
  114. data/spec/spec_helper.rb +1 -0
  115. metadata +179 -0
@@ -0,0 +1,417 @@
1
+ /* forms.css.scss
2
+ * Base styles for various input types, form layouts, and states
3
+ * ------------------------------------------------------------- */
4
+
5
+ // FORM STYLES
6
+ // -----------
7
+
8
+ form {
9
+ margin-bottom: $baseline;
10
+ }
11
+
12
+ // Groups of fields with labels on top (legends)
13
+ fieldset {
14
+ margin-bottom: $baseline;
15
+ padding-top: $baseline;
16
+ legend {
17
+ display: block;
18
+ padding-left: 150px;
19
+ font-size: $basefont * 1.5;
20
+ line-height: 1;
21
+ color: $grayDark;
22
+ *padding: 0 0 5px 145px; /* IE6-7 */
23
+ *line-height: 1.5; /* IE6-7 */
24
+ }
25
+ }
26
+
27
+ // Parent element that clears floats and wraps labels and fields together
28
+ form .clearfix {
29
+ margin-bottom: $baseline;
30
+ @include clearfix()
31
+ }
32
+
33
+ // Set font for forms
34
+ label, input, select, textarea {
35
+ @include sans-serif-font(normal,13px,normal);
36
+ }
37
+
38
+ // Float labels left
39
+ label {
40
+ padding-top: 6px;
41
+ font-size: $basefont;
42
+ line-height: $baseline;
43
+ float: left;
44
+ width: 130px;
45
+ text-align: right;
46
+ color: $grayDark;
47
+ }
48
+
49
+ // Shift over the inside div to align all label's relevant content
50
+ form .input {
51
+ margin-left: 150px;
52
+ }
53
+
54
+ // Checkboxs and radio buttons
55
+ input[type=checkbox], input[type=radio] {
56
+ cursor: pointer;
57
+ }
58
+
59
+ // Inputs, Textareas, Selects
60
+ input, textarea, select, .uneditable-input {
61
+ display: inline-block;
62
+ width: 210px;
63
+ height: $baseline;
64
+ padding: 4px;
65
+ font-size: $basefont;
66
+ line-height: $baseline;
67
+ color: $gray;
68
+ border: 1px solid #ccc;
69
+ @include border-radius(3px);
70
+ }
71
+
72
+ /* mini reset for non-html5 file types */
73
+ input[type=checkbox], input[type=radio] {
74
+ width: auto;
75
+ height: auto;
76
+ padding: 0;
77
+ margin: 3px 0;
78
+ *margin-top: 0; /* IE6-7 */
79
+ line-height: normal;
80
+ border: none;
81
+ }
82
+
83
+ input[type=file] {
84
+ background-color: $white;
85
+ padding: initial;
86
+ border: initial;
87
+ line-height: initial;
88
+ @include box-shadow(none);
89
+ }
90
+
91
+ input[type=button], input[type=reset], input[type=submit] {
92
+ width: auto;
93
+ height: auto;
94
+ }
95
+
96
+ select, input[type=file] {
97
+ height: $baseline * 1.5; // In IE7, the height of the select element cannot be changed by height, only font-size
98
+ line-height: $baseline * 1.5;
99
+ *margin-top: 4px; /* For IE7, add top margin to align select with labels */
100
+ }
101
+
102
+ // Make multiple select elements height not fixed
103
+ select[multiple] {
104
+ height: inherit;
105
+ }
106
+
107
+ textarea {
108
+ height: auto;
109
+ }
110
+
111
+ // For text that needs to appear as an input but should not be an input
112
+ .uneditable-input {
113
+ background-color: $white;
114
+ display: block;
115
+ border-color: #eee;
116
+ @include box-shadow(inset 0 1px 2px rgba(0,0,0,.025));
117
+ cursor: not-allowed;
118
+ }
119
+
120
+ // Placeholder text gets special styles; can't be bundled together though for some reason
121
+ :-moz-placeholder {
122
+ color: $grayLight;
123
+ }
124
+ ::-webkit-input-placeholder {
125
+ color: $grayLight;
126
+ }
127
+
128
+ // Focus states
129
+ input, textarea {
130
+ $transition: border linear .2s, box-shadow linear .2s;
131
+ @include transition($transition);
132
+ @include box-shadow(inset 0 1px 3px rgba(0,0,0,.1));
133
+ }
134
+ input:focus, textarea:focus {
135
+ outline: 0;
136
+ border-color: rgba(82,168,236,.8);
137
+ $shadow: inset 0 1px 3px rgba(0,0,0,.1), 0 0 8px rgba(82,168,236,.6);
138
+ @include box-shadow($shadow);
139
+ }
140
+ input[type=file]:focus, input[type=checkbox]:focus, select:focus {
141
+ @include box-shadow(none); // override for file inputs
142
+ outline: 1px dotted #666; // Selet elements don't get box-shadow styles, so instead we do outline
143
+ }
144
+
145
+ // Error styles
146
+ form div.clearfix.error {
147
+ background: lighten($red, 57%);
148
+ padding: 10px 0;
149
+ margin: -10px 0 10px;
150
+ @include border-radius(4px);
151
+ $error-text: desaturate(lighten($red, 25%), 25%);
152
+ > label, span.help-inline, span.help-block {
153
+ color: $red;
154
+ }
155
+ input, textarea {
156
+ border-color: $error-text;
157
+ @include box-shadow(0 0 3px rgba(171,41,32,.25));
158
+ &:focus {
159
+ border-color: darken($error-text, 10%);
160
+ @include box-shadow(0 0 6px rgba(171,41,32,.5));
161
+ }
162
+ }
163
+ .input-prepend, .input-append {
164
+ span.add-on {
165
+ background: lighten($red, 50%);
166
+ border-color: $error-text;
167
+ color: darken($error-text, 10%);
168
+ }
169
+ }
170
+ }
171
+
172
+ // Form element sizes
173
+ // TODO v2: remove duplication here and just stick to .input-[size] in light of adding .spanN sizes
174
+ .input-mini, input.mini, textarea.mini, select.mini {
175
+ width: 60px;
176
+ }
177
+ .input-small, input.small, textarea.small, select.small {
178
+ width: 90px;
179
+ }
180
+ .input-medium, input.medium, textarea.medium, select.medium {
181
+ width: 150px;
182
+ }
183
+ .input-large, input.large, textarea.large, select.large {
184
+ width: 210px;
185
+ }
186
+ .input-xlarge, input.xlarge, textarea.xlarge, select.xlarge {
187
+ width: 270px;
188
+ }
189
+ .input-xxlarge, input.xxlarge, textarea.xxlarge, select.xxlarge {
190
+ width: 530px;
191
+ }
192
+ textarea.xxlarge {
193
+ overflow-y: auto;
194
+ }
195
+
196
+ // Grid style input sizes
197
+ // This is a duplication of the main grid .columns() mixin, but subtracts 10px to account for input padding and border
198
+ @mixin formColumns($columnSpan: 1) {
199
+ display: inline-block;
200
+ float: none;
201
+ width: (($gridColumnWidth - 10) * $columnSpan) + (($gridColumnWidth - 10) * ($columnSpan - 1));
202
+ margin-left: 0;
203
+ }
204
+ input, textarea, select {
205
+ // Default columns
206
+ &.span1 { @include formColumns(1); }
207
+ &.span2 { @include formColumns(2); }
208
+ &.span3 { @include formColumns(3); }
209
+ &.span4 { @include formColumns(4); }
210
+ &.span5 { @include formColumns(5); }
211
+ &.span6 { @include formColumns(6); }
212
+ &.span7 { @include formColumns(7); }
213
+ &.span8 { @include formColumns(8); }
214
+ &.span9 { @include formColumns(9); }
215
+ &.span10 { @include formColumns(10); }
216
+ &.span11 { @include formColumns(11); }
217
+ &.span12 { @include formColumns(12); }
218
+ &.span13 { @include formColumns(13); }
219
+ &.span14 { @include formColumns(14); }
220
+ &.span15 { @include formColumns(15); }
221
+ &.span16 { @include formColumns(16); }
222
+ }
223
+
224
+ // Disabled and read-only inputs
225
+ input[disabled], select[disabled], textarea[disabled], input[readonly], select[readonly], textarea[readonly] {
226
+ background-color: #f5f5f5;
227
+ border-color: #ddd;
228
+ cursor: not-allowed;
229
+ }
230
+
231
+ // Actions (the buttons)
232
+ .actions {
233
+ background: #f5f5f5;
234
+ margin-top: $baseline;
235
+ margin-bottom: $baseline;
236
+ padding: ($baseline - 1) 20px $baseline 150px;
237
+ border-top: 1px solid #ddd;
238
+ @include border-radius(0 0 3px 3px);
239
+ .secondary-action {
240
+ float: right;
241
+ a {
242
+ line-height: 30px;
243
+ &:hover {
244
+ text-decoration: underline;
245
+ }
246
+ }
247
+ }
248
+ }
249
+
250
+ // Help Text
251
+ .help-inline, .help-block {
252
+ font-size: $basefont - 2;
253
+ line-height: $baseline;
254
+ color: $grayLight;
255
+ }
256
+ .help-inline {
257
+ padding-left: 5px;
258
+ *position: relative; /* IE6-7 */
259
+ *top: -5px; /* IE6-7 */
260
+ }
261
+
262
+ // Big blocks of help text
263
+ .help-block {
264
+ display: block;
265
+ max-width: 600px;
266
+ }
267
+
268
+ // Inline Fields (input fields that appear as inline objects
269
+ .inline-inputs {
270
+ color: $gray;
271
+ span, input {
272
+ display: inline-block;
273
+ }
274
+ input.mini {
275
+ width: 60px;
276
+ }
277
+ input.small {
278
+ width: 90px;
279
+ }
280
+ span {
281
+ padding: 0 2px 0 1px;
282
+ }
283
+ }
284
+
285
+ // Allow us to put symbols and text within the input field for a cleaner look
286
+ .input-prepend, .input-append {
287
+ input {
288
+ @include border-radius(0 3px 3px 0);
289
+ }
290
+ .add-on {
291
+ position: relative;
292
+ background: #f5f5f5;
293
+ border: 1px solid #ccc;
294
+ z-index: 2;
295
+ float: left;
296
+ display: block;
297
+ width: auto;
298
+ min-width: 16px;
299
+ height: 18px;
300
+ padding: 4px 4px 4px 5px;
301
+ margin-right: -1px;
302
+ font-weight: normal;
303
+ line-height: 18px;
304
+ color: $grayLight;
305
+ text-align: center;
306
+ text-shadow: 0 1px 0 $white;
307
+ @include border-radius(3px 0 0 3px);
308
+ }
309
+ .active {
310
+ background: lighten($green, 30);
311
+ border-color: $green;
312
+ }
313
+ }
314
+ .input-prepend {
315
+ .add-on {
316
+ *margin-top: 1px; /* IE6-7 */
317
+ }
318
+ }
319
+ .input-append {
320
+ input {
321
+ float: left;
322
+ @include border-radius(3px 0 0 3px);
323
+ }
324
+ .add-on {
325
+ @include border-radius(0 3px 3px 0);
326
+ margin-right: 0;
327
+ margin-left: -1px;
328
+ }
329
+ }
330
+
331
+ // Stacked options for forms (radio buttons or checkboxes)
332
+ .inputs-list {
333
+ margin: 0 0 5px;
334
+ width: 100%;
335
+ li {
336
+ display: block;
337
+ padding: 0;
338
+ width: 100%;
339
+ }
340
+ label {
341
+ display: block;
342
+ float: none;
343
+ width: auto;
344
+ padding: 0;
345
+ line-height: $baseline;
346
+ text-align: left;
347
+ white-space: normal;
348
+ strong {
349
+ color: $gray;
350
+ }
351
+ small {
352
+ font-size: $basefont - 2;
353
+ font-weight: normal;
354
+ }
355
+ }
356
+ .inputs-list {
357
+ margin-left: 25px;
358
+ margin-bottom: 10px;
359
+ padding-top: 0;
360
+ }
361
+ &:first-child {
362
+ padding-top: 6px;
363
+ }
364
+ li + li {
365
+ padding-top: 2px;
366
+ }
367
+ input[type=radio], input[type=checkbox] {
368
+ margin-bottom: 0;
369
+ }
370
+ }
371
+
372
+ // Stacked forms
373
+ .form-stacked {
374
+ padding-left: 20px;
375
+ fieldset {
376
+ padding-top: $baseline / 2;
377
+ }
378
+ legend {
379
+ padding-left: 0;
380
+ }
381
+ label {
382
+ display: block;
383
+ float: none;
384
+ width: auto;
385
+ font-weight: bold;
386
+ text-align: left;
387
+ line-height: 20px;
388
+ padding-top: 0;
389
+ }
390
+ .clearfix {
391
+ margin-bottom: $baseline / 2;
392
+ div.input {
393
+ margin-left: 0;
394
+ }
395
+ }
396
+ .inputs-list {
397
+ margin-bottom: 0;
398
+ li {
399
+ padding-top: 0;
400
+ label {
401
+ font-weight: normal;
402
+ padding-top: 0;
403
+ }
404
+ }
405
+ }
406
+ div.clearfix.error {
407
+ padding-top: 10px;
408
+ padding-bottom: 10px;
409
+ padding-left: 10px;
410
+ margin-top: 0;
411
+ margin-left: -10px;
412
+ }
413
+ .actions {
414
+ margin-left: -20px;
415
+ padding-left: 20px;
416
+ }
417
+ }
@@ -0,0 +1,211 @@
1
+ /* mixins.css.scss
2
+ * Snippets of reusable CSS to develop faster and keep code readable
3
+ * ----------------------------------------------------------------- */
4
+
5
+
6
+ // Clearfix for clearing floats like a boss h5bp.com/q
7
+ @mixin clearfix() {
8
+ zoom: 1;
9
+ &:before,
10
+ &:after {
11
+ display: table;
12
+ content: "";
13
+ zoom: 1;
14
+ *display: inline;
15
+ }
16
+ &:after {
17
+ clear: both;
18
+ }
19
+ }
20
+
21
+ // Center-align a block level element
22
+ @mixin center-block() {
23
+ display: block;
24
+ margin-left: auto;
25
+ margin-right: auto;
26
+ }
27
+
28
+ // Sizing shortcuts
29
+ @mixin size($height: 5px, $width: 5px) {
30
+ height: $height;
31
+ width: $width;
32
+ }
33
+ @mixin square($size: 5px) {
34
+ @include size($size, $size);
35
+ }
36
+
37
+ // Input placeholder text
38
+ @mixin placeholder($color: $grayLight) {
39
+ :-moz-placeholder {
40
+ color: $color;
41
+ }
42
+ ::-webkit-input-placeholder {
43
+ color: $color;
44
+ }
45
+ }
46
+
47
+ // Font Stacks
48
+ @mixin shorthand-font($weight: normal, $size: 14px, $lineHeight: 20px) {
49
+ font-size: $size;
50
+ font-weight: $weight;
51
+ line-height: $lineHeight;
52
+ }
53
+ @mixin sans-serif-font($weight: normal, $size: 14px, $lineHeight: 20px) {
54
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
55
+ font-size: $size;
56
+ font-weight: $weight;
57
+ line-height: $lineHeight;
58
+ }
59
+ @mixin serif-font($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;
64
+ }
65
+ @mixin monospace-font($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;
70
+ }
71
+
72
+ // Grid System
73
+ @mixin fixed-container() {
74
+ width: $siteWidth;
75
+ margin-left: auto;
76
+ margin-right: auto;
77
+ @include clearfix();
78
+ }
79
+ @mixin columns($columnSpan: 1) {
80
+ width: ($gridColumnWidth * $columnSpan) + ($gridGutterWidth * ($columnSpan - 1));
81
+ }
82
+ @mixin offset($columnOffset: 1) {
83
+ margin-left: ($gridColumnWidth * $columnOffset) + ($gridGutterWidth * ($columnOffset - 1)) + $extraSpace;
84
+ }
85
+ // Necessary grid styles for every column to make them appear next to each other horizontally
86
+ @mixin gridColumn() {
87
+ display: inline;
88
+ float: left;
89
+ margin-left: $gridGutterWidth;
90
+ }
91
+ // makeColumn can be used to mark any element (e.g., .content-primary) as a column without changing markup to .span something
92
+ @mixin makeColumn($columnSpan: 1) {
93
+ @include gridColumn();
94
+ @include columns($columnSpan);
95
+ }
96
+
97
+ // Border Radius
98
+ @mixin border-radius($radius: 5px) {
99
+ -webkit-border-radius: $radius;
100
+ -moz-border-radius: $radius;
101
+ border-radius: $radius;
102
+ }
103
+
104
+ // Drop shadows
105
+ @mixin box-shadow($shadow: 0 1px 3px rgba(0,0,0,.25)) {
106
+ -webkit-box-shadow: $shadow;
107
+ -moz-box-shadow: $shadow;
108
+ box-shadow: $shadow;
109
+ }
110
+
111
+ // Transitions
112
+ @mixin transition($transition) {
113
+ -webkit-transition: $transition;
114
+ -moz-transition: $transition;
115
+ -ms-transition: $transition;
116
+ -o-transition: $transition;
117
+ transition: $transition;
118
+ }
119
+
120
+ // Background clipping
121
+ @mixin background-clip($clip) {
122
+ -webkit-background-clip: $clip;
123
+ -moz-background-clip: $clip;
124
+ background-clip: $clip;
125
+ }
126
+
127
+ // CSS3 Content Columns
128
+ @mixin content-columns($columnCount, $columnGap: 20px) {
129
+ -webkit-column-count: $columnCount;
130
+ -moz-column-count: $columnCount;
131
+ column-count: $columnCount;
132
+ -webkit-column-gap: $columnGap;
133
+ -moz-column-gap: $columnGap;
134
+ column-gap: $columnGap;
135
+ }
136
+
137
+ // Add an alphatransparency value to any background or border color (via Elyse Holladay)
138
+ @mixin background-translucent($color: $white, $alpha: 1) {
139
+ background-color: hsla(hue($color), saturation($color), lightness($color), $alpha);
140
+ }
141
+ @mixin border-translucent($color: $white, $alpha: 1) {
142
+ border-color: hsla(hue($color), saturation($color), lightness($color), $alpha);
143
+ background-clip: padding-box;
144
+ }
145
+
146
+ // Gradient Bar Colors for buttons and allerts
147
+ @mixin gradientBar($primaryColor, $secondaryColor) {
148
+ @include vertical-gradient($primaryColor, $secondaryColor);
149
+ text-shadow: 0 -1px 1px rgba(0,0,0,.25);
150
+ border-color: $secondaryColor $secondaryColor darken($secondaryColor, 15%);
151
+ border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
152
+ }
153
+
154
+ // Gradients
155
+ @mixin horizontal-gradient($startColor: #555, $endColor: #333) {
156
+ background-color: $endColor;
157
+ background-repeat: repeat-x;
158
+ background-image: -khtml-gradient(linear, left top, right top, from($startColor), to($endColor)); // Konqueror
159
+ background-image: -moz-linear-gradient(left, $startColor, $endColor); // FF 3.6+
160
+ background-image: -ms-linear-gradient(left, $startColor, $endColor); // IE10
161
+ background-image: -webkit-gradient(linear, left top, right top, color-stop(0%, $startColor), color-stop(100%, $endColor)); // Safari 4+, Chrome 2+
162
+ background-image: -webkit-linear-gradient(left, $startColor, $endColor); // Safari 5.1+, Chrome 10+
163
+ background-image: -o-linear-gradient(left, $startColor, $endColor); // Opera 11.10
164
+ background-image: linear-gradient(left, $startColor, $endColor); // Le standard
165
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$startColor}, endColorstr=#{$endColor}, GradientType=1); // IE9 and down
166
+ }
167
+ @mixin vertical-gradient($startColor: #555, $endColor: #333) {
168
+ background-color: $endColor;
169
+ background-repeat: repeat-x;
170
+ background-image: -khtml-gradient(linear, left top, left bottom, from($startColor), to($endColor)); // Konqueror
171
+ background-image: -moz-linear-gradient(top, $startColor, $endColor); // FF 3.6+
172
+ background-image: -ms-linear-gradient(top, $startColor, $endColor); // IE10
173
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, $startColor), color-stop(100%, $endColor)); // Safari 4+, Chrome 2+
174
+ background-image: -webkit-linear-gradient(top, $startColor, $endColor); // Safari 5.1+, Chrome 10+
175
+ background-image: -o-linear-gradient(top, $startColor, $endColor); // Opera 11.10
176
+ background-image: linear-gradient(top, $startColor, $endColor); // The standard
177
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$startColor}, endColorstr=#{$endColor}, GradientType=0); // IE9 and down
178
+ }
179
+ @mixin directional-gradient($startColor: #555, $endColor: #333, $deg: 45deg) {
180
+ background-color: $endColor;
181
+ background-repeat: repeat-x;
182
+ background-image: -moz-linear-gradient($deg, $startColor, $endColor); // FF 3.6+
183
+ background-image: -ms-linear-gradient($deg, $startColor, $endColor); // IE10
184
+ background-image: -webkit-linear-gradient($deg, $startColor, $endColor); // Safari 5.1+, Chrome 10+
185
+ background-image: -o-linear-gradient($deg, $startColor, $endColor); // Opera 11.10
186
+ background-image: linear-gradient($deg, $startColor, $endColor); // The standard
187
+ }
188
+ @mixin vertical-three-colors-gradient($startColor: #00b3ee, $midColor: #7a43b6, $colorStop: 50%, $endColor: #c3325f) {
189
+ background-color: $endColor;
190
+ background-repeat: no-repeat;
191
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from($startColor), color-stop($colorStop, $midColor), to($endColor));
192
+ background-image: -webkit-linear-gradient($startColor, $midColor $colorStop, $endColor);
193
+ background-image: -moz-linear-gradient(top, $startColor, $midColor $colorStop, $endColor);
194
+ background-image: -ms-linear-gradient($startColor, $midColor $colorStop, $endColor);
195
+ background-image: -o-linear-gradient($startColor, $midColor $colorStop, $endColor);
196
+ background-image: linear-gradient($startColor, $midColor $colorStop, $endColor);
197
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$startColor}, endColorstr=#{$endColor}, GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback
198
+ }
199
+
200
+ // Reset filters for IE
201
+ @mixin reset-filter() {
202
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false)
203
+ }
204
+
205
+ // Opacity
206
+ @mixin opacity($opacity: 100) {
207
+ filter: alpha(opacity=#{$opacity});
208
+ -khtml-opacity: $opacity / 100;
209
+ -moz-opacity: $opacity / 100;
210
+ opacity: $opacity / 100;
211
+ }