twitter-bootstrap 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +39 -0
  4. data/app/assets/javascripts/bootstrap-alerts.js +111 -0
  5. data/app/assets/javascripts/bootstrap-dropdown.js +53 -0
  6. data/app/assets/javascripts/bootstrap-modal.js +244 -0
  7. data/app/assets/javascripts/bootstrap-popover.js +77 -0
  8. data/app/assets/javascripts/bootstrap-scrollspy.js +105 -0
  9. data/app/assets/javascripts/bootstrap-tabs.js +77 -0
  10. data/app/assets/javascripts/bootstrap-twipsy.js +303 -0
  11. data/app/assets/javascripts/twitter_bootstrap/application.js +9 -0
  12. data/app/assets/stylesheets/bootsrap-defaults.css.less +26 -0
  13. data/app/assets/stylesheets/bootsrap-forms.css.less +464 -0
  14. data/app/assets/stylesheets/bootsrap-mixins.css.less +217 -0
  15. data/app/assets/stylesheets/bootsrap-patterns.css.less +1006 -0
  16. data/app/assets/stylesheets/bootsrap-reset.css.less +141 -0
  17. data/app/assets/stylesheets/bootsrap-scaffolding.css.less +135 -0
  18. data/app/assets/stylesheets/bootsrap-tables.css.less +170 -0
  19. data/app/assets/stylesheets/bootsrap-type.css.less +187 -0
  20. data/app/assets/stylesheets/bootsrap-variables.css.less +60 -0
  21. data/app/controllers/twitter_bootstrap/application_controller.rb +4 -0
  22. data/app/helpers/twitter_bootstrap/application_helper.rb +4 -0
  23. data/app/views/layouts/twitter_bootstrap/application.html.erb +14 -0
  24. data/config/routes.rb +2 -0
  25. data/lib/tasks/twitter_bootstrap_tasks.rake +4 -0
  26. data/lib/twitter_bootstrap.rb +4 -0
  27. data/lib/twitter_bootstrap/engine.rb +5 -0
  28. data/lib/twitter_bootstrap/version.rb +3 -0
  29. data/test/dummy/Rakefile +7 -0
  30. data/test/dummy/app/assets/javascripts/application.js +9 -0
  31. data/test/dummy/app/assets/stylesheets/application.css +7 -0
  32. data/test/dummy/app/controllers/application_controller.rb +3 -0
  33. data/test/dummy/app/helpers/application_helper.rb +2 -0
  34. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  35. data/test/dummy/config.ru +4 -0
  36. data/test/dummy/config/application.rb +45 -0
  37. data/test/dummy/config/boot.rb +10 -0
  38. data/test/dummy/config/database.yml +25 -0
  39. data/test/dummy/config/environment.rb +5 -0
  40. data/test/dummy/config/environments/development.rb +30 -0
  41. data/test/dummy/config/environments/production.rb +60 -0
  42. data/test/dummy/config/environments/test.rb +42 -0
  43. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  44. data/test/dummy/config/initializers/inflections.rb +10 -0
  45. data/test/dummy/config/initializers/mime_types.rb +5 -0
  46. data/test/dummy/config/initializers/secret_token.rb +7 -0
  47. data/test/dummy/config/initializers/session_store.rb +8 -0
  48. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  49. data/test/dummy/config/locales/en.yml +5 -0
  50. data/test/dummy/config/routes.rb +4 -0
  51. data/test/dummy/public/404.html +26 -0
  52. data/test/dummy/public/422.html +26 -0
  53. data/test/dummy/public/500.html +26 -0
  54. data/test/dummy/public/favicon.ico +0 -0
  55. data/test/dummy/script/rails +6 -0
  56. data/test/integration/navigation_test.rb +10 -0
  57. data/test/test_helper.rb +10 -0
  58. data/test/twitter_bootstrap_test.rb +7 -0
  59. metadata +168 -0
@@ -0,0 +1,9 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require_tree .
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * Bootstrap @VERSION
3
+ *
4
+ * Copyright 2011 Twitter, Inc
5
+ * Licensed under the Apache License v2.0
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
9
+ * Date: @DATE
10
+ */
11
+
12
+ // CSS Reset
13
+ @import "reset.less";
14
+
15
+ // Core variables and mixins
16
+ @import "variables.less"; // Modify this for custom colors, font-sizes, etc
17
+ @import "mixins.less";
18
+
19
+ // Grid system and page structure
20
+ @import "scaffolding.less";
21
+
22
+ // Styled patterns and elements
23
+ @import "type.less";
24
+ @import "forms.less";
25
+ @import "tables.less";
26
+ @import "patterns.less";
@@ -0,0 +1,464 @@
1
+ /* Forms.less
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
+ .clearfix()
31
+ }
32
+
33
+ // Set font for forms
34
+ label,
35
+ input,
36
+ select,
37
+ textarea {
38
+ #font > .sans-serif(normal,13px,normal);
39
+ }
40
+
41
+ // Float labels left
42
+ label {
43
+ padding-top: 6px;
44
+ font-size: @basefont;
45
+ line-height: @baseline;
46
+ float: left;
47
+ width: 130px;
48
+ text-align: right;
49
+ color: @grayDark;
50
+ }
51
+
52
+ // Shift over the inside div to align all label's relevant content
53
+ form .input {
54
+ margin-left: 150px;
55
+ }
56
+
57
+ // Checkboxs and radio buttons
58
+ input[type=checkbox],
59
+ input[type=radio] {
60
+ cursor: pointer;
61
+ }
62
+
63
+ // Inputs, Textareas, Selects
64
+ input,
65
+ textarea,
66
+ select,
67
+ .uneditable-input {
68
+ display: inline-block;
69
+ width: 210px;
70
+ height: @baseline;
71
+ padding: 4px;
72
+ font-size: @basefont;
73
+ line-height: @baseline;
74
+ color: @gray;
75
+ border: 1px solid #ccc;
76
+ .border-radius(3px);
77
+ }
78
+
79
+ /* mini reset for non-html5 file types */
80
+ input[type=checkbox],
81
+ input[type=radio] {
82
+ width: auto;
83
+ height: auto;
84
+ padding: 0;
85
+ margin: 3px 0;
86
+ *margin-top: 0; /* IE6-7 */
87
+ line-height: normal;
88
+ border: none;
89
+ }
90
+
91
+ input[type=file] {
92
+ background-color: @white;
93
+ padding: initial;
94
+ border: initial;
95
+ line-height: initial;
96
+ .box-shadow(none);
97
+ }
98
+
99
+ input[type=button],
100
+ input[type=reset],
101
+ input[type=submit] {
102
+ width: auto;
103
+ height: auto;
104
+ }
105
+
106
+ select,
107
+ input[type=file] {
108
+ height: @baseline * 1.5; // In IE7, the height of the select element cannot be changed by height, only font-size
109
+ line-height: @baseline * 1.5;
110
+ *margin-top: 4px; /* For IE7, add top margin to align select with labels */
111
+ }
112
+
113
+ // Make multiple select elements height not fixed
114
+ select[multiple] {
115
+ height: inherit;
116
+ }
117
+
118
+ textarea {
119
+ height: auto;
120
+ }
121
+
122
+ // For text that needs to appear as an input but should not be an input
123
+ .uneditable-input {
124
+ background-color: @white;
125
+ display: block;
126
+ border-color: #eee;
127
+ .box-shadow(inset 0 1px 2px rgba(0,0,0,.025));
128
+ cursor: not-allowed;
129
+ }
130
+
131
+ // Placeholder text gets special styles; can't be bundled together though for some reason
132
+ :-moz-placeholder {
133
+ color: @grayLight;
134
+ }
135
+ ::-webkit-input-placeholder {
136
+ color: @grayLight;
137
+ }
138
+
139
+ // Focus states
140
+ input,
141
+ textarea {
142
+ @transition: border linear .2s, box-shadow linear .2s;
143
+ .transition(@transition);
144
+ .box-shadow(inset 0 1px 3px rgba(0,0,0,.1));
145
+ }
146
+ input:focus,
147
+ textarea:focus {
148
+ outline: 0;
149
+ border-color: rgba(82,168,236,.8);
150
+ @shadow: inset 0 1px 3px rgba(0,0,0,.1), 0 0 8px rgba(82,168,236,.6);
151
+ .box-shadow(@shadow);
152
+ }
153
+ input[type=file]:focus,
154
+ input[type=checkbox]:focus,
155
+ select:focus {
156
+ .box-shadow(none); // override for file inputs
157
+ outline: 1px dotted #666; // Selet elements don't get box-shadow styles, so instead we do outline
158
+ }
159
+
160
+ // Error styles
161
+ form div.clearfix.error {
162
+ background: lighten(@red, 57%);
163
+ padding: 10px 0;
164
+ margin: -10px 0 10px;
165
+ .border-radius(4px);
166
+ @error-text: desaturate(lighten(@red, 25%), 25%);
167
+ > label,
168
+ span.help-inline,
169
+ span.help-block {
170
+ color: @red;
171
+ }
172
+ input,
173
+ textarea {
174
+ border-color: @error-text;
175
+ .box-shadow(0 0 3px rgba(171,41,32,.25));
176
+ &:focus {
177
+ border-color: darken(@error-text, 10%);
178
+ .box-shadow(0 0 6px rgba(171,41,32,.5));
179
+ }
180
+ }
181
+ .input-prepend,
182
+ .input-append {
183
+ span.add-on {
184
+ background: lighten(@red, 50%);
185
+ border-color: @error-text;
186
+ color: darken(@error-text, 10%);
187
+ }
188
+ }
189
+ }
190
+
191
+ // Form element sizes
192
+ // TODO v2: remove duplication here and just stick to .input-[size] in light of adding .spanN sizes
193
+ .input-mini,
194
+ input.mini,
195
+ textarea.mini,
196
+ select.mini {
197
+ width: 60px;
198
+ }
199
+ .input-small,
200
+ input.small,
201
+ textarea.small,
202
+ select.small {
203
+ width: 90px;
204
+ }
205
+ .input-medium,
206
+ input.medium,
207
+ textarea.medium,
208
+ select.medium {
209
+ width: 150px;
210
+ }
211
+ .input-large,
212
+ input.large,
213
+ textarea.large,
214
+ select.large {
215
+ width: 210px;
216
+ }
217
+ .input-xlarge,
218
+ input.xlarge,
219
+ textarea.xlarge,
220
+ select.xlarge {
221
+ width: 270px;
222
+ }
223
+ .input-xxlarge,
224
+ input.xxlarge,
225
+ textarea.xxlarge,
226
+ select.xxlarge {
227
+ width: 530px;
228
+ }
229
+ textarea.xxlarge {
230
+ overflow-y: auto;
231
+ }
232
+
233
+ // Grid style input sizes
234
+ // This is a duplication of the main grid .columns() mixin, but subtracts 10px to account for input padding and border
235
+ .formColumns(@columnSpan: 1) {
236
+ display: inline-block;
237
+ float: none;
238
+ width: ((@gridColumnWidth - 10) * @columnSpan) + ((@gridColumnWidth - 10) * (@columnSpan - 1));
239
+ margin-left: 0;
240
+ }
241
+ input,
242
+ textarea,
243
+ select {
244
+ // Default columns
245
+ &.span1 { .formColumns(1); }
246
+ &.span2 { .formColumns(2); }
247
+ &.span3 { .formColumns(3); }
248
+ &.span4 { .formColumns(4); }
249
+ &.span5 { .formColumns(5); }
250
+ &.span6 { .formColumns(6); }
251
+ &.span7 { .formColumns(7); }
252
+ &.span8 { .formColumns(8); }
253
+ &.span9 { .formColumns(9); }
254
+ &.span10 { .formColumns(10); }
255
+ &.span11 { .formColumns(11); }
256
+ &.span12 { .formColumns(12); }
257
+ &.span13 { .formColumns(13); }
258
+ &.span14 { .formColumns(14); }
259
+ &.span15 { .formColumns(15); }
260
+ &.span16 { .formColumns(16); }
261
+ }
262
+
263
+ // Disabled and read-only inputs
264
+ input[disabled],
265
+ select[disabled],
266
+ textarea[disabled],
267
+ input[readonly],
268
+ select[readonly],
269
+ textarea[readonly] {
270
+ background-color: #f5f5f5;
271
+ border-color: #ddd;
272
+ cursor: not-allowed;
273
+ }
274
+
275
+ // Actions (the buttons)
276
+ .actions {
277
+ background: #f5f5f5;
278
+ margin-top: @baseline;
279
+ margin-bottom: @baseline;
280
+ padding: (@baseline - 1) 20px @baseline 150px;
281
+ border-top: 1px solid #ddd;
282
+ .border-radius(0 0 3px 3px);
283
+ .secondary-action {
284
+ float: right;
285
+ a {
286
+ line-height: 30px;
287
+ &:hover {
288
+ text-decoration: underline;
289
+ }
290
+ }
291
+ }
292
+ }
293
+
294
+ // Help Text
295
+ .help-inline,
296
+ .help-block {
297
+ font-size: @basefont - 2;
298
+ line-height: @baseline;
299
+ color: @grayLight;
300
+ }
301
+ .help-inline {
302
+ padding-left: 5px;
303
+ *position: relative; /* IE6-7 */
304
+ *top: -5px; /* IE6-7 */
305
+ }
306
+
307
+ // Big blocks of help text
308
+ .help-block {
309
+ display: block;
310
+ max-width: 600px;
311
+ }
312
+
313
+ // Inline Fields (input fields that appear as inline objects
314
+ .inline-inputs {
315
+ color: @gray;
316
+ span, input {
317
+ display: inline-block;
318
+ }
319
+ input.mini {
320
+ width: 60px;
321
+ }
322
+ input.small {
323
+ width: 90px;
324
+ }
325
+ span {
326
+ padding: 0 2px 0 1px;
327
+ }
328
+ }
329
+
330
+ // Allow us to put symbols and text within the input field for a cleaner look
331
+ .input-prepend,
332
+ .input-append {
333
+ input {
334
+ .border-radius(0 3px 3px 0);
335
+ }
336
+ .add-on {
337
+ position: relative;
338
+ background: #f5f5f5;
339
+ border: 1px solid #ccc;
340
+ z-index: 2;
341
+ float: left;
342
+ display: block;
343
+ width: auto;
344
+ min-width: 16px;
345
+ height: 18px;
346
+ padding: 4px 4px 4px 5px;
347
+ margin-right: -1px;
348
+ font-weight: normal;
349
+ line-height: 18px;
350
+ color: @grayLight;
351
+ text-align: center;
352
+ text-shadow: 0 1px 0 @white;
353
+ .border-radius(3px 0 0 3px);
354
+ }
355
+ .active {
356
+ background: lighten(@green, 30);
357
+ border-color: @green;
358
+ }
359
+ }
360
+ .input-prepend {
361
+ .add-on {
362
+ *margin-top: 1px; /* IE6-7 */
363
+ }
364
+ }
365
+ .input-append {
366
+ input {
367
+ float: left;
368
+ .border-radius(3px 0 0 3px);
369
+ }
370
+ .add-on {
371
+ .border-radius(0 3px 3px 0);
372
+ margin-right: 0;
373
+ margin-left: -1px;
374
+ }
375
+ }
376
+
377
+ // Stacked options for forms (radio buttons or checkboxes)
378
+ .inputs-list {
379
+ margin: 0 0 5px;
380
+ width: 100%;
381
+ li {
382
+ display: block;
383
+ padding: 0;
384
+ width: 100%;
385
+ }
386
+ label {
387
+ display: block;
388
+ float: none;
389
+ width: auto;
390
+ padding: 0;
391
+ line-height: @baseline;
392
+ text-align: left;
393
+ white-space: normal;
394
+ strong {
395
+ color: @gray;
396
+ }
397
+ small {
398
+ font-size: @basefont - 2;
399
+ font-weight: normal;
400
+ }
401
+ }
402
+ .inputs-list {
403
+ margin-left: 25px;
404
+ margin-bottom: 10px;
405
+ padding-top: 0;
406
+ }
407
+ &:first-child {
408
+ padding-top: 6px;
409
+ }
410
+ li + li {
411
+ padding-top: 2px;
412
+ }
413
+ input[type=radio],
414
+ input[type=checkbox] {
415
+ margin-bottom: 0;
416
+ }
417
+ }
418
+
419
+ // Stacked forms
420
+ .form-stacked {
421
+ padding-left: 20px;
422
+ fieldset {
423
+ padding-top: @baseline / 2;
424
+ }
425
+ legend {
426
+ padding-left: 0;
427
+ }
428
+ label {
429
+ display: block;
430
+ float: none;
431
+ width: auto;
432
+ font-weight: bold;
433
+ text-align: left;
434
+ line-height: 20px;
435
+ padding-top: 0;
436
+ }
437
+ .clearfix {
438
+ margin-bottom: @baseline / 2;
439
+ div.input {
440
+ margin-left: 0;
441
+ }
442
+ }
443
+ .inputs-list {
444
+ margin-bottom: 0;
445
+ li {
446
+ padding-top: 0;
447
+ label {
448
+ font-weight: normal;
449
+ padding-top: 0;
450
+ }
451
+ }
452
+ }
453
+ div.clearfix.error {
454
+ padding-top: 10px;
455
+ padding-bottom: 10px;
456
+ padding-left: 10px;
457
+ margin-top: 0;
458
+ margin-left: -10px;
459
+ }
460
+ .actions {
461
+ margin-left: -20px;
462
+ padding-left: 20px;
463
+ }
464
+ }