kickoff 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
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,960 @@
1
+ /* patters.css.scss
2
+ * Repeatable UI elements outside the base styles provided from the scaffolding
3
+ * ---------------------------------------------------------------------------- */
4
+
5
+
6
+ // TOPBAR
7
+ // ------
8
+
9
+ // Topbar for Branding and Nav
10
+ .topbar {
11
+ height: 40px;
12
+ position: fixed;
13
+ top: 0;
14
+ left: 0;
15
+ right: 0;
16
+ z-index: 10000;
17
+ overflow: visible;
18
+
19
+ // Links get text shadow
20
+ a {
21
+ color: $grayLight;
22
+ text-shadow: 0 -1px 0 rgba(0,0,0,.25);
23
+ }
24
+
25
+ // Hover and active states
26
+ // h3 for backwards compatibility
27
+ h3 a:hover, .brand a:hover, ul .active > a {
28
+ background-color: #333;
29
+ background-color: rgba(255,255,255,.05);
30
+ color: $white;
31
+ text-decoration: none;
32
+ }
33
+
34
+ // Website name
35
+ // h3 left for backwards compatibility
36
+ h3 {
37
+ position: relative;
38
+ }
39
+ h3 a, .brand {
40
+ float: left;
41
+ display: block;
42
+ padding: 8px 20px 12px;
43
+ margin-left: -20px; // negative indent to left-align the text down the page
44
+ color: $white;
45
+ font-size: 20px;
46
+ font-weight: 200;
47
+ line-height: 1;
48
+ }
49
+
50
+ // Plain text in topbar
51
+ p {
52
+ margin: 0;
53
+ line-height: 40px;
54
+ a:hover {
55
+ background-color: transparent;
56
+ color: $white;
57
+ }
58
+ }
59
+
60
+ // Search Form
61
+ form {
62
+ float: left;
63
+ margin: 5px 0 0 0;
64
+ position: relative;
65
+ @include opacity(100);
66
+ }
67
+ // Todo: remove from v2.0 when ready, added for legacy
68
+ form.pull-right {
69
+ float: right;
70
+ }
71
+ input {
72
+ background-color: #444;
73
+ background-color: rgba(255,255,255,.3);
74
+ @include sans-serif-font(13px, normal, 1);
75
+ padding: 4px 9px;
76
+ color: $white;
77
+ color: rgba(255,255,255,.75);
78
+ border: 1px solid #111;
79
+ @include border-radius(4px);
80
+ $shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.25);
81
+ @include box-shadow($shadow);
82
+ @include transition(none);
83
+
84
+ // Placeholder text gets special styles; can't be bundled together though for some reason
85
+ &:-moz-placeholder {
86
+ color: $grayLighter;
87
+ }
88
+ &::-webkit-input-placeholder {
89
+ color: $grayLighter;
90
+ }
91
+ // Hover states
92
+ &:hover {
93
+ background-color: $grayLight;
94
+ background-color: rgba(255,255,255,.5);
95
+ color: $white;
96
+ }
97
+ // Focus states (we use .focused since IE8 and down doesn't support :focus)
98
+ &:focus, &.focused {
99
+ outline: 0;
100
+ background-color: $white;
101
+ color: $grayDark;
102
+ text-shadow: 0 1px 0 $white;
103
+ border: 0;
104
+ padding: 5px 10px;
105
+ @include box-shadow(0 0 3px rgba(0,0,0,.15));
106
+ }
107
+ }
108
+ }
109
+
110
+ // gradient is applied to it's own element because overflow visible is not honored by ie when filter is present
111
+ // For backwards compatibility, include .topbar .fill
112
+ .topbar-inner, .topbar .fill {
113
+ background-color: #222;
114
+ @include vertical-gradient(#333, #222);
115
+ $shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);
116
+ @include box-shadow($shadow);
117
+ }
118
+
119
+ // NAVIGATION
120
+ // ----------
121
+
122
+ // Topbar Nav
123
+ // ul.nav for all topbar based navigation to avoid inheritance issues and over-specificity
124
+ // For backwards compatibility, leave in .topbar div > ul
125
+ .topbar div > ul, .nav {
126
+ display: block;
127
+ float: left;
128
+ margin: 0 10px 0 0;
129
+ position: relative;
130
+ left: 0;
131
+ > li {
132
+ display: block;
133
+ float: left;
134
+ }
135
+ a {
136
+ display: block;
137
+ float: none;
138
+ padding: 10px 10px 11px;
139
+ line-height: 19px;
140
+ text-decoration: none;
141
+ &:hover {
142
+ color: $white;
143
+ text-decoration: none;
144
+ }
145
+ }
146
+ .active > a {
147
+ background-color: #222;
148
+ background-color: rgba(0,0,0,.5);
149
+ }
150
+
151
+ // Secondary (floated right) nav in topbar
152
+ &.secondary-nav {
153
+ float: right;
154
+ margin-left: 10px;
155
+ margin-right: 0;
156
+ // backwards compatibility
157
+ .menu-dropdown, .dropdown-menu {
158
+ right: 0;
159
+ border: 0;
160
+ }
161
+ }
162
+ // Dropdowns within the .nav
163
+ // a.menu:hover and li.open .menu for backwards compatibility
164
+ a.menu:hover, li.open .menu, .dropdown-toggle:hover, .dropdown.open .dropdown-toggle {
165
+ background: #444;
166
+ background: rgba(255,255,255,.05);
167
+ }
168
+ // .menu-dropdown for backwards compatibility
169
+ .menu-dropdown, .dropdown-menu {
170
+ background-color: #333;
171
+ // a.menu for backwards compatibility
172
+ a.menu, .dropdown-toggle {
173
+ color: $white;
174
+ &.open {
175
+ background: #444;
176
+ background: rgba(255,255,255,.05);
177
+ }
178
+ }
179
+ li a {
180
+ color: #999;
181
+ text-shadow: 0 1px 0 rgba(0,0,0,.5);
182
+ &:hover {
183
+ @include vertical-gradient(#292929,#191919);
184
+ color: $white;
185
+ }
186
+ }
187
+ .active a {
188
+ color: $white;
189
+ }
190
+ .divider {
191
+ background-color: #222;
192
+ border-color: #444;
193
+ }
194
+ }
195
+ }
196
+
197
+ // For backwards compatibility with new dropdowns, redeclare dropdown link padding
198
+ .topbar ul .menu-dropdown li a, .topbar ul .dropdown-menu li a {
199
+ padding: 4px 15px;
200
+ }
201
+
202
+ // Dropdown Menus
203
+ // Use the .menu class on any <li> element within the topbar or ul.tabs and you'll get some superfancy dropdowns
204
+ // li.menu for backwards compatibility
205
+ li.menu, .dropdown {
206
+ position: relative;
207
+ }
208
+ // The link that is clicked to toggle the dropdown
209
+ // a.menu for backwards compatibility
210
+ a.menu:after, .dropdown-toggle:after {
211
+ width: 0;
212
+ height: 0;
213
+ display: inline-block;
214
+ content: "&darr;";
215
+ text-indent: -99999px;
216
+ vertical-align: top;
217
+ margin-top: 8px;
218
+ margin-left: 4px;
219
+ border-left: 4px solid transparent;
220
+ border-right: 4px solid transparent;
221
+ border-top: 4px solid $white;
222
+ @include opacity(50);
223
+ }
224
+ // The dropdown menu (ul)
225
+ // .menu-dropdown for backwards compatibility
226
+ .menu-dropdown, .dropdown-menu {
227
+ background-color: $white;
228
+ float: left;
229
+ display: none; // None by default, but block on "open" of the menu
230
+ position: absolute;
231
+ top: 40px;
232
+ z-index: 900;
233
+ min-width: 160px;
234
+ max-width: 220px;
235
+ _width: 160px;
236
+ margin-left: 0; // override default ul styles
237
+ margin-right: 0;
238
+ padding: 6px 0;
239
+ zoom: 1; // do we need this?
240
+ border-color: #999;
241
+ border-color: rgba(0,0,0,.2);
242
+ border-style: solid;
243
+ border-width: 0 1px 1px;
244
+ @include border-radius(0 0 6px 6px);
245
+ @include box-shadow(0 2px 4px rgba(0,0,0,.2));
246
+ @include background-clip(padding-box);
247
+
248
+ // Unfloat any li's to make them stack
249
+ li {
250
+ float: none;
251
+ display: block;
252
+ background-color: none;
253
+ }
254
+ // Dividers (basically an hr) within the dropdown
255
+ .divider {
256
+ height: 1px;
257
+ margin: 5px 0;
258
+ overflow: hidden;
259
+ background-color: #eee;
260
+ border-bottom: 1px solid $white;
261
+ }
262
+ }
263
+
264
+ .topbar .dropdown-menu, .dropdown-menu {
265
+ // Links within the dropdown menu
266
+ a {
267
+ display: block;
268
+ padding: 4px 15px;
269
+ clear: both;
270
+ font-weight: normal;
271
+ line-height: 18px;
272
+ color: $gray;
273
+ text-shadow: 0 1px 0 $white;
274
+ // Hover state
275
+ &:hover {
276
+ @include vertical-gradient(#eeeeee, #dddddd);
277
+ color: $grayDark;
278
+ text-decoration: none;
279
+ $shadow: inset 0 1px 0 rgba(0,0,0,.025), inset 0 -1px rgba(0,0,0,.025);
280
+ @include box-shadow($shadow);
281
+ }
282
+ }
283
+ }
284
+
285
+ // Open state for the dropdown
286
+ // .open for backwards compatibility
287
+ .open, .dropdown.open {
288
+ // .menu for backwards compatibility
289
+ .menu, .dropdown-toggle {
290
+ color: $white;
291
+ background: #ccc;
292
+ background: rgba(0,0,0,.3);
293
+ }
294
+ // .menu-dropdown for backwards compatibility
295
+ .menu-dropdown, .dropdown-menu {
296
+ display: block;
297
+ }
298
+ }
299
+
300
+ // Tabs and Pills
301
+ .tabs, .pills {
302
+ margin: 0 0 20px;
303
+ padding: 0;
304
+ list-style: none;
305
+ @include clearfix();
306
+ > li {
307
+ float: left;
308
+ > a {
309
+ display: block;
310
+ }
311
+ }
312
+ }
313
+
314
+ // Basic Tabs
315
+ .tabs {
316
+ float: left;
317
+ width: 100%;
318
+ border-bottom: 1px solid #ddd;
319
+ > li {
320
+ position: relative; // For the dropdowns mostly
321
+ top: 1px;
322
+ > a {
323
+ padding: 0 15px;
324
+ margin-right: 2px;
325
+ line-height: $baseline * 2;
326
+ border: 1px solid transparent;
327
+ @include border-radius(4px 4px 0 0);
328
+ &:hover {
329
+ text-decoration: none;
330
+ background-color: #eee;
331
+ border-color: #eee #eee #ddd;
332
+ }
333
+ }
334
+ &.active > a {
335
+ color: $gray;
336
+ background-color: $white;
337
+ border: 1px solid #ddd;
338
+ border-bottom-color: transparent;
339
+ }
340
+ }
341
+ // first one for backwards compatibility
342
+ .menu-dropdown, .dropdown-menu {
343
+ top: 35px;
344
+ border-width: 1px;
345
+ @include border-radius(0 6px 6px 6px);
346
+ }
347
+ // first one for backwards compatibility
348
+ a.menu:after, .dropdown-toggle:after {
349
+ border-top-color: #999;
350
+ margin-top: 15px;
351
+ margin-left: 5px;
352
+ }
353
+ // first one for backwards compatibility
354
+ li.open.menu .menu, .open.dropdown .dropdown-toggle {
355
+ border-color: #999;
356
+ }
357
+ // first one for backwards compatibility
358
+ li.open a.menu:after, .dropdown.open .dropdown-toggle:after {
359
+ border-top-color: #555;
360
+ }
361
+ }
362
+ .tab-content {
363
+ clear: both;
364
+ }
365
+
366
+ // Basic pill nav
367
+ .pills {
368
+ a {
369
+ margin: 5px 3px 5px 0;
370
+ padding: 0 15px;
371
+ text-shadow: 0 1px 1px $white;
372
+ line-height: 30px;
373
+ @include border-radius(15px);
374
+ &:hover {
375
+ background: $linkColorHover;
376
+ color: $white;
377
+ text-decoration: none;
378
+ text-shadow: 0 1px 1px rgba(0,0,0,.25);
379
+ }
380
+ }
381
+ .active a {
382
+ background: $linkColor;
383
+ color: $white;
384
+ text-shadow: 0 1px 1px rgba(0,0,0,.25);
385
+ }
386
+ }
387
+
388
+ .tab-content > *, .pill-content > * {
389
+ display: none;
390
+ }
391
+
392
+ .tab-content > .active, .pill-content > .active {
393
+ display:block;
394
+ }
395
+
396
+ // BREADCRUMBS
397
+ // -----------
398
+
399
+ .breadcrumb {
400
+ margin: 0 0 $baseline;
401
+ padding: 7px 14px;
402
+ @include vertical-gradient(#ffffff, #f5f5f5);
403
+ border: 1px solid #ddd;
404
+ @include border-radius(3px);
405
+ @include box-shadow(inset 0 1px 0 $white);
406
+ li {
407
+ display: inline;
408
+ text-shadow: 0 1px 0 $white;
409
+ }
410
+ .divider {
411
+ padding: 0 5px;
412
+ color: $grayLight;
413
+ }
414
+ a {
415
+ }
416
+ .active a {
417
+ color: $grayDark;
418
+ }
419
+ }
420
+
421
+
422
+ // PAGE HEADERS
423
+ // ------------
424
+
425
+ .hero-unit {
426
+ background-color: #f5f5f5;
427
+ margin-bottom: 30px;
428
+ padding: 60px;
429
+ @include border-radius(6px);
430
+ h1 {
431
+ margin-bottom: 0;
432
+ font-size: 60px;
433
+ line-height: 1;
434
+ letter-spacing: -1px;
435
+ }
436
+ p {
437
+ font-size: 18px;
438
+ font-weight: 200;
439
+ line-height: $baseline * 1.5;
440
+ }
441
+ }
442
+ footer {
443
+ margin-top: $baseline - 1;
444
+ padding-top: $baseline - 1;
445
+ border-top: 1px solid #eee;
446
+ }
447
+
448
+
449
+ // PAGE HEADERS
450
+ // ------------
451
+
452
+ .page-header {
453
+ margin-bottom: $baseline - 1;
454
+ border-bottom: 1px solid #ddd;
455
+ @include box-shadow(0 1px 0 rgba(255,255,255,.5));
456
+ h1 {
457
+ margin-bottom: ($baseline / 2) - 1px;
458
+ }
459
+ }
460
+
461
+
462
+ // BUTTON STYLES
463
+ // -------------
464
+
465
+ // Shared colors for buttons and alerts
466
+ .btn, .alert-message {
467
+ // Set text color
468
+ &.danger, &.danger:hover, &.error, &.error:hover, &.success, &.success:hover, &.info, &.info:hover {
469
+ color: $white
470
+ }
471
+ // Danger and error appear as red
472
+ &.danger, &.error {
473
+ @include gradientBar(#ff6161, #be0006);
474
+ }
475
+ // Success appears as green
476
+ &.success {
477
+ @include gradientBar(#43da62, #02901f);
478
+ }
479
+ // Info appears as orange
480
+ &.info {
481
+ @include gradientBar(#ffa76a, #da5800);
482
+ }
483
+ }
484
+
485
+ // Base .btn styles
486
+ .btn {
487
+ // Button Base
488
+ cursor: pointer;
489
+ display: inline-block;
490
+ @include vertical-three-colors-gradient(#ffffff, #ffffff, 25%, darken(#ffffff, 10%)); // Don't use .gradientbar() here since it does a three-color gradient
491
+ padding: 5px 14px 6px;
492
+ text-shadow: 0 1px 1px rgba(255,255,255,1.0);
493
+ color: #555;
494
+ font-size: $basefont;
495
+ font-weight: bold;
496
+ line-height: normal;
497
+ border: 1px solid #AAA;
498
+ border-bottom-color: #999;
499
+ @include border-radius(5px);
500
+ $shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
501
+ @include box-shadow($shadow);
502
+
503
+ &:hover {
504
+ background-position: 0 -15px;
505
+ color: #333;
506
+ text-decoration: none;
507
+ }
508
+
509
+ // Focus state for keyboard and accessibility
510
+ &:focus {
511
+ outline: 1px dotted #666;
512
+ }
513
+
514
+ // Primary Button Type
515
+ &.primary {
516
+ color: $white;
517
+ @include gradientBar($blue, $blueDark)
518
+ }
519
+
520
+ // Transitions
521
+ @include transition(.1s linear all);
522
+
523
+ // Active and Disabled states
524
+ &:active {
525
+ $shadow: inset 0 2px 4px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.05);
526
+ @include box-shadow($shadow);
527
+ }
528
+ &.disabled {
529
+ cursor: default;
530
+ background-image: none;
531
+ @include reset-filter();
532
+ @include opacity(65);
533
+ @include box-shadow(none);
534
+ }
535
+ &[disabled] {
536
+ // disabled pseudo can't be included with .disabled
537
+ // def because IE8 and below will drop it ;_;
538
+ cursor: default;
539
+ background-image: none;
540
+ @include reset-filter();
541
+ @include opacity(65);
542
+ @include box-shadow(none);
543
+ }
544
+
545
+ // Button Sizes
546
+ &.large {
547
+ font-size: $basefont + 2px;
548
+ line-height: normal;
549
+ padding: 9px 14px 9px;
550
+ @include border-radius(6px);
551
+ }
552
+ &.small {
553
+ padding: 7px 9px 7px;
554
+ font-size: $basefont - 2px;
555
+ }
556
+ }
557
+ // Super jank hack for removing border-radius from IE9 so we can keep filter gradients on alerts and buttons
558
+ :root .alert-message, :root .btn {
559
+ border-radius: 0 \0;
560
+ }
561
+
562
+ // Help Firefox not be a jerk about adding extra padding to buttons
563
+ button.btn, input[type=submit].btn {
564
+ &::-moz-focus-inner {
565
+ padding: 0;
566
+ border: 0;
567
+ }
568
+ }
569
+
570
+
571
+ // CLOSE ICONS
572
+ // -----------
573
+ .close {
574
+ float: right;
575
+ color: $black;
576
+ font-size: 20px;
577
+ font-weight: bold;
578
+ line-height: $baseline * .75;
579
+ text-shadow: 0 1px 0 rgba(255,255,255,1);
580
+ @include opacity(20);
581
+ &:hover {
582
+ color: $black;
583
+ text-decoration: none;
584
+ @include opacity(40);
585
+ }
586
+ }
587
+
588
+
589
+ // ERROR STYLES
590
+ // ------------
591
+
592
+ // Base alert styles
593
+ .alert-message {
594
+ position: relative;
595
+ padding: 7px 15px;
596
+ margin-bottom: $baseline;
597
+ color: $grayDark;
598
+ @include gradientBar(#fceec1, #eedc94); // warning by default
599
+ text-shadow: 0 1px 0 rgba(255,255,255,.5);
600
+ border-width: 1px;
601
+ border-style: solid;
602
+ @include border-radius(4px);
603
+ @include box-shadow(inset 0 1px 0 rgba(255,255,255,.25));
604
+
605
+ // Adjust close icon
606
+ .close {
607
+ *margin-top: 3px; /* IE7 spacing */
608
+ }
609
+
610
+ // Remove extra margin from content
611
+ h5 {
612
+ line-height: $baseline;
613
+ }
614
+ p {
615
+ margin-bottom: 0;
616
+ }
617
+ div {
618
+ margin-top: 5px;
619
+ margin-bottom: 2px;
620
+ line-height: 28px;
621
+ }
622
+ .btn {
623
+ // Provide actions with buttons
624
+ @include box-shadow(0 1px 0 rgba(255,255,255,.25));
625
+ }
626
+
627
+ &.block-message {
628
+ background-image: none;
629
+ background-color: lighten(#fceec1, 5%);
630
+ @include reset-filter();
631
+ padding: 14px;
632
+ border-color: #fceec1;
633
+ @include box-shadow(none);
634
+ ul, p {
635
+ margin-right: 30px;
636
+ }
637
+ ul {
638
+ margin-bottom: 0;
639
+ }
640
+ li {
641
+ color: $grayDark;
642
+ }
643
+ .alert-actions {
644
+ margin-top: 5px;
645
+ }
646
+ &.error, &.success, &.info {
647
+ color: $grayDark;
648
+ text-shadow: 0 1px 0 rgba(255,255,255,.5);
649
+ }
650
+ &.error {
651
+ background-color: lighten(#f56a66, 25%);
652
+ border-color: lighten(#f56a66, 20%);
653
+ }
654
+ &.success {
655
+ background-color: lighten(#62c462, 30%);
656
+ border-color: lighten(#62c462, 25%);
657
+ }
658
+ &.info {
659
+ background-color: lighten(#6bd0ee, 25%);
660
+ border-color: lighten(#6bd0ee, 20%);
661
+ }
662
+ }
663
+ }
664
+
665
+
666
+ // PAGINATION
667
+ // ----------
668
+
669
+ .pagination {
670
+ height: $baseline * 2;
671
+ margin: $baseline 0;
672
+ ul {
673
+ float: left;
674
+ margin: 0;
675
+ border: 1px solid #ddd;
676
+ border: 1px solid rgba(0,0,0,.15);
677
+ @include border-radius(3px);
678
+ @include box-shadow(0 1px 2px rgba(0,0,0,.05));
679
+ }
680
+ li {
681
+ display: inline;
682
+ }
683
+ a {
684
+ float: left;
685
+ padding: 0 14px;
686
+ line-height: ($baseline * 2) - 2;
687
+ border-right: 1px solid;
688
+ border-right-color: #ddd;
689
+ border-right-color: rgba(0,0,0,.15);
690
+ *border-right-color: #ddd; /* IE6-7 */
691
+ text-decoration: none;
692
+ }
693
+ a:hover, .active a {
694
+ background-color: lighten($blue, 45%);
695
+ }
696
+ .disabled a, .disabled a:hover {
697
+ background-color: transparent;
698
+ color: $grayLight;
699
+ }
700
+ .next a {
701
+ border: 0;
702
+ }
703
+ }
704
+
705
+
706
+ // WELLS
707
+ // -----
708
+
709
+ .well {
710
+ background-color: #f5f5f5;
711
+ margin-bottom: 20px;
712
+ padding: 19px;
713
+ min-height: 20px;
714
+ border: 1px solid #eee;
715
+ border: 1px solid rgba(0,0,0,.05);
716
+ @include border-radius(4px);
717
+ @include box-shadow(inset 0 1px 1px rgba(0,0,0,.05));
718
+ blockquote {
719
+ border-color: #ddd;
720
+ border-color: rgba(0,0,0,.15);
721
+ }
722
+ }
723
+
724
+
725
+ // MODALS
726
+ // ------
727
+
728
+ .modal-backdrop {
729
+ background-color: $black;
730
+ position: fixed;
731
+ top: 0;
732
+ left: 0;
733
+ right: 0;
734
+ bottom: 0;
735
+ z-index: 10000;
736
+ // Fade for backdrop
737
+ &.fade { opacity: 0; }
738
+ }
739
+
740
+ .modal-backdrop, .modal-backdrop.fade.in {
741
+ @include opacity(80);
742
+ }
743
+
744
+ .modal {
745
+ position: fixed;
746
+ top: 50%;
747
+ left: 50%;
748
+ z-index: 11000;
749
+ width: 560px;
750
+ margin: -250px 0 0 -250px;
751
+ background-color: $white;
752
+ border: 1px solid #999;
753
+ border: 1px solid rgba(0,0,0,.3);
754
+ *border: 1px solid #999; /* IE6-7 */
755
+ @include border-radius(6px);
756
+ @include box-shadow(0 3px 7px rgba(0,0,0,0.3));
757
+ @include background-clip(padding-box);
758
+ .close { margin-top: 7px; }
759
+ &.fade {
760
+ $trans: opacity .3s linear, top .3s ease-out;
761
+ @include transition($trans);
762
+ top: -25%;
763
+ }
764
+ &.fade.in { top: 50%; }
765
+ }
766
+ .modal-header {
767
+ border-bottom: 1px solid #eee;
768
+ padding: 5px 15px;
769
+ }
770
+ .modal-body {
771
+ padding: 15px;
772
+ }
773
+ .modal-footer {
774
+ background-color: #f5f5f5;
775
+ padding: 14px 15px 15px;
776
+ border-top: 1px solid #ddd;
777
+ @include border-radius(0 0 6px 6px);
778
+ @include box-shadow(inset 0 1px 0 $white);
779
+ @include clearfix();
780
+ margin-bottom: 0;
781
+ .btn {
782
+ float: right;
783
+ margin-left: 5px;
784
+ }
785
+ }
786
+
787
+
788
+ // POPOVER ARROWS
789
+ // --------------
790
+
791
+ @mixin above-arrow($arrowWidth: 5px) {
792
+ bottom: 0;
793
+ left: 50%;
794
+ margin-left: -$arrowWidth;
795
+ border-left: $arrowWidth solid transparent;
796
+ border-right: $arrowWidth solid transparent;
797
+ border-top: $arrowWidth solid $black;
798
+ }
799
+ @mixin left-arrow($arrowWidth: 5px) {
800
+ top: 50%;
801
+ right: 0;
802
+ margin-top: -$arrowWidth;
803
+ border-top: $arrowWidth solid transparent;
804
+ border-bottom: $arrowWidth solid transparent;
805
+ border-left: $arrowWidth solid $black;
806
+ }
807
+ @mixin below-arrow($arrowWidth: 5px) {
808
+ top: 0;
809
+ left: 50%;
810
+ margin-left: -$arrowWidth;
811
+ border-left: $arrowWidth solid transparent;
812
+ border-right: $arrowWidth solid transparent;
813
+ border-bottom: $arrowWidth solid $black;
814
+ }
815
+ @mixin right-arrow($arrowWidth: 5px) {
816
+ top: 50%;
817
+ left: 0;
818
+ margin-top: -$arrowWidth;
819
+ border-top: $arrowWidth solid transparent;
820
+ border-bottom: $arrowWidth solid transparent;
821
+ border-right: $arrowWidth solid $black;
822
+ }
823
+
824
+ // TWIPSY
825
+ // ------
826
+
827
+ .twipsy {
828
+ display: block;
829
+ position: absolute;
830
+ visibility: visible;
831
+ padding: 5px;
832
+ font-size: 11px;
833
+ z-index: 1000;
834
+ @include opacity(80);
835
+ &.fade.in {
836
+ @include opacity(80);
837
+ }
838
+ &.above .twipsy-arrow { @include above-arrow(); }
839
+ &.left .twipsy-arrow { @include left-arrow(); }
840
+ &.below .twipsy-arrow { @include below-arrow(); }
841
+ &.right .twipsy-arrow { @include right-arrow(); }
842
+ }
843
+ .twipsy-inner {
844
+ padding: 3px 8px;
845
+ background-color: $black;
846
+ color: white;
847
+ text-align: center;
848
+ max-width: 200px;
849
+ text-decoration: none;
850
+ @include border-radius(4px);
851
+ }
852
+ .twipsy-arrow {
853
+ position: absolute;
854
+ width: 0;
855
+ height: 0;
856
+ }
857
+
858
+
859
+ // POPOVERS
860
+ // --------
861
+
862
+ .popover {
863
+ position: absolute;
864
+ top: 0;
865
+ left: 0;
866
+ z-index: 1000;
867
+ padding: 5px;
868
+ display: none;
869
+ &.above .arrow { @include above-arrow(); }
870
+ &.right .arrow { @include right-arrow(); }
871
+ &.below .arrow { @include below-arrow(); }
872
+ &.left .arrow { @include left-arrow(); }
873
+ .arrow {
874
+ position: absolute;
875
+ width: 0;
876
+ height: 0;
877
+ }
878
+ .inner {
879
+ background-color: $black;
880
+ background-color: rgba(0,0,0,.8);
881
+ padding: 3px;
882
+ overflow: hidden;
883
+ width: 280px;
884
+ @include border-radius(6px);
885
+ @include box-shadow(0 3px 7px rgba(0,0,0,0.3));
886
+ }
887
+ .title {
888
+ background-color: #f5f5f5;
889
+ padding: 9px 15px;
890
+ line-height: 1;
891
+ @include border-radius(3px 3px 0 0);
892
+ border-bottom:1px solid #eee;
893
+ }
894
+ .content {
895
+ background-color: $white;
896
+ padding: 14px;
897
+ @include border-radius(0 0 3px 3px);
898
+ @include background-clip(padding-box);
899
+ p, ul, ol {
900
+ margin-bottom: 0;
901
+ }
902
+ }
903
+ }
904
+
905
+
906
+ // PATTERN ANIMATIONS
907
+ // ------------------
908
+
909
+ .fade {
910
+ @include transition(opacity .15s linear);
911
+ opacity: 0;
912
+ &.in {
913
+ opacity: 1;
914
+ }
915
+ }
916
+
917
+ // LABELS
918
+ // ------
919
+
920
+ .label {
921
+ padding: 1px 3px 2px;
922
+ background-color: $grayLight;
923
+ font-size: $basefont * .75;
924
+ font-weight: bold;
925
+ color: $white;
926
+ text-transform: uppercase;
927
+ @include border-radius(3px);
928
+ &.important { background-color: #c43c35; }
929
+ &.warning { background-color: $orange; }
930
+ &.success { background-color: $green; }
931
+ &.notice { background-color: lighten($blue, 25%); }
932
+ }
933
+
934
+
935
+ // MEDIA GRIDS
936
+ // -----------
937
+
938
+ .media-grid {
939
+ margin-left: -20px;
940
+ margin-bottom: 0;
941
+ @include clearfix();
942
+ li {
943
+ display: inline;
944
+ }
945
+ a {
946
+ float: left;
947
+ padding: 4px;
948
+ margin: 0 0 20px 20px;
949
+ border: 1px solid #ddd;
950
+ @include border-radius(4px);
951
+ @include box-shadow(0 1px 1px rgba(0,0,0,.075));
952
+ img {
953
+ display: block;
954
+ }
955
+ &:hover {
956
+ border-color: $linkColor;
957
+ @include box-shadow(0 1px 4px rgba(0,105,214,.25));
958
+ }
959
+ }
960
+ }