bootstrap-on-rails 0.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 (66) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +4 -0
  3. data/README.md +34 -0
  4. data/Rakefile +1 -0
  5. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  6. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +228 -0
  7. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  8. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  9. data/app/assets/javascripts/bootstrap/affix.js +126 -0
  10. data/app/assets/javascripts/bootstrap/alert.js +98 -0
  11. data/app/assets/javascripts/bootstrap/button.js +109 -0
  12. data/app/assets/javascripts/bootstrap/carousel.js +217 -0
  13. data/app/assets/javascripts/bootstrap/collapse.js +179 -0
  14. data/app/assets/javascripts/bootstrap/dropdown.js +154 -0
  15. data/app/assets/javascripts/bootstrap/modal.js +246 -0
  16. data/app/assets/javascripts/bootstrap/popover.js +117 -0
  17. data/app/assets/javascripts/bootstrap/scrollspy.js +158 -0
  18. data/app/assets/javascripts/bootstrap/tab.js +135 -0
  19. data/app/assets/javascripts/bootstrap/tooltip.js +386 -0
  20. data/app/assets/javascripts/bootstrap/transition.js +56 -0
  21. data/app/assets/stylesheets/bootstrap/alerts.less +67 -0
  22. data/app/assets/stylesheets/bootstrap/badges.less +51 -0
  23. data/app/assets/stylesheets/bootstrap/bootstrap.less +58 -0
  24. data/app/assets/stylesheets/bootstrap/breadcrumbs.less +23 -0
  25. data/app/assets/stylesheets/bootstrap/button-groups.less +248 -0
  26. data/app/assets/stylesheets/bootstrap/buttons.less +160 -0
  27. data/app/assets/stylesheets/bootstrap/carousel.less +209 -0
  28. data/app/assets/stylesheets/bootstrap/close.less +33 -0
  29. data/app/assets/stylesheets/bootstrap/code.less +56 -0
  30. data/app/assets/stylesheets/bootstrap/component-animations.less +29 -0
  31. data/app/assets/stylesheets/bootstrap/dropdowns.less +193 -0
  32. data/app/assets/stylesheets/bootstrap/forms.less +362 -0
  33. data/app/assets/stylesheets/bootstrap/glyphicons.less +236 -0
  34. data/app/assets/stylesheets/bootstrap/grid.less +346 -0
  35. data/app/assets/stylesheets/bootstrap/input-groups.less +127 -0
  36. data/app/assets/stylesheets/bootstrap/jumbotron.less +40 -0
  37. data/app/assets/stylesheets/bootstrap/labels.less +58 -0
  38. data/app/assets/stylesheets/bootstrap/list-group.less +88 -0
  39. data/app/assets/stylesheets/bootstrap/media.less +56 -0
  40. data/app/assets/stylesheets/bootstrap/mixins.less +744 -0
  41. data/app/assets/stylesheets/bootstrap/modals.less +141 -0
  42. data/app/assets/stylesheets/bootstrap/navbar.less +621 -0
  43. data/app/assets/stylesheets/bootstrap/navs.less +229 -0
  44. data/app/assets/stylesheets/bootstrap/normalize.less +396 -0
  45. data/app/assets/stylesheets/bootstrap/pager.less +55 -0
  46. data/app/assets/stylesheets/bootstrap/pagination.less +85 -0
  47. data/app/assets/stylesheets/bootstrap/panels.less +148 -0
  48. data/app/assets/stylesheets/bootstrap/popovers.less +133 -0
  49. data/app/assets/stylesheets/bootstrap/print.less +100 -0
  50. data/app/assets/stylesheets/bootstrap/progress-bars.less +95 -0
  51. data/app/assets/stylesheets/bootstrap/responsive-utilities.less +220 -0
  52. data/app/assets/stylesheets/bootstrap/scaffolding.less +130 -0
  53. data/app/assets/stylesheets/bootstrap/tables.less +238 -0
  54. data/app/assets/stylesheets/bootstrap/theme.less +241 -0
  55. data/app/assets/stylesheets/bootstrap/thumbnails.less +31 -0
  56. data/app/assets/stylesheets/bootstrap/tooltip.less +95 -0
  57. data/app/assets/stylesheets/bootstrap/type.less +242 -0
  58. data/app/assets/stylesheets/bootstrap/utilities.less +42 -0
  59. data/app/assets/stylesheets/bootstrap/variables.less +635 -0
  60. data/app/assets/stylesheets/bootstrap/wells.less +29 -0
  61. data/bootstrap-on-rails.gemspec +25 -0
  62. data/lib/bootstrap-on-rails.rb +6 -0
  63. data/lib/bootstrap-on-rails/engine.rb +4 -0
  64. data/lib/bootstrap-on-rails/version.rb +3 -0
  65. data/test/test_helper.rb +2 -0
  66. metadata +112 -0
@@ -0,0 +1,29 @@
1
+ //
2
+ // Component animations
3
+ // --------------------------------------------------
4
+
5
+ // Heads up!
6
+ //
7
+ // We don't use the `.opacity()` mixin here since it causes a bug with text
8
+ // fields in IE7-8. Source: https://github.com/twitter/bootstrap/pull/3552.
9
+
10
+ .fade {
11
+ opacity: 0;
12
+ .transition(opacity .15s linear);
13
+ &.in {
14
+ opacity: 1;
15
+ }
16
+ }
17
+
18
+ .collapse {
19
+ display: none;
20
+ &.in {
21
+ display: block;
22
+ }
23
+ }
24
+ .collapsing {
25
+ position: relative;
26
+ height: 0;
27
+ overflow: hidden;
28
+ .transition(height .35s ease);
29
+ }
@@ -0,0 +1,193 @@
1
+ //
2
+ // Dropdown menus
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Dropdown arrow/caret
7
+ .caret {
8
+ display: inline-block;
9
+ width: 0;
10
+ height: 0;
11
+ margin-left: 2px;
12
+ vertical-align: middle;
13
+ border-top: @caret-width-base solid @dropdown-caret-color;
14
+ border-right: @caret-width-base solid transparent;
15
+ border-left: @caret-width-base solid transparent;
16
+ // Firefox fix for https://github.com/twbs/bootstrap/issues/9538. Once fixed,
17
+ // we can just straight up remove this.
18
+ border-bottom: 0 dotted;
19
+ content: "";
20
+ }
21
+
22
+ // The dropdown wrapper (div)
23
+ .dropdown {
24
+ position: relative;
25
+ }
26
+
27
+ // Prevent the focus on the dropdown toggle when closing dropdowns
28
+ .dropdown-toggle:focus {
29
+ outline: 0;
30
+ }
31
+
32
+ // The dropdown menu (ul)
33
+ .dropdown-menu {
34
+ position: absolute;
35
+ top: 100%;
36
+ left: 0;
37
+ z-index: @zindex-dropdown;
38
+ display: none; // none by default, but block on "open" of the menu
39
+ float: left;
40
+ min-width: 160px;
41
+ padding: 5px 0;
42
+ margin: 2px 0 0; // override default ul
43
+ list-style: none;
44
+ font-size: @font-size-base;
45
+ background-color: @dropdown-bg;
46
+ border: 1px solid @dropdown-fallback-border; // IE8 fallback
47
+ border: 1px solid @dropdown-border;
48
+ border-radius: @border-radius-base;
49
+ .box-shadow(0 6px 12px rgba(0,0,0,.175));
50
+ background-clip: padding-box;
51
+
52
+ // Aligns the dropdown menu to right
53
+ &.pull-right {
54
+ right: 0;
55
+ left: auto;
56
+ }
57
+
58
+ // Dividers (basically an hr) within the dropdown
59
+ .divider {
60
+ .nav-divider(@dropdown-divider-bg);
61
+ }
62
+
63
+ // Links within the dropdown menu
64
+ > li > a {
65
+ display: block;
66
+ padding: 3px 20px;
67
+ clear: both;
68
+ font-weight: normal;
69
+ line-height: @line-height-base;
70
+ color: @dropdown-link-color;
71
+ white-space: nowrap; // prevent links from randomly breaking onto new lines
72
+ }
73
+ }
74
+
75
+ // Hover/Focus state
76
+ .dropdown-menu > li > a {
77
+ &:hover,
78
+ &:focus {
79
+ text-decoration: none;
80
+ color: @dropdown-link-hover-color;
81
+ background-color: @dropdown-link-hover-bg;
82
+ }
83
+ }
84
+
85
+ // Active state
86
+ .dropdown-menu > .active > a {
87
+ &,
88
+ &:hover,
89
+ &:focus {
90
+ color: @dropdown-link-active-color;
91
+ text-decoration: none;
92
+ outline: 0;
93
+ background-color: @dropdown-link-active-bg;
94
+ }
95
+ }
96
+
97
+ // Disabled state
98
+ //
99
+ // Gray out text and ensure the hover/focus state remains gray
100
+
101
+ .dropdown-menu > .disabled > a {
102
+ &,
103
+ &:hover,
104
+ &:focus {
105
+ color: @dropdown-link-disabled-color;
106
+ }
107
+ }
108
+ // Nuke hover/focus effects
109
+ .dropdown-menu > .disabled > a {
110
+ &:hover,
111
+ &:focus {
112
+ text-decoration: none;
113
+ background-color: transparent;
114
+ background-image: none; // Remove CSS gradient
115
+ .reset-filter();
116
+ cursor: not-allowed;
117
+ }
118
+ }
119
+
120
+ // Open state for the dropdown
121
+ .open {
122
+ // Show the menu
123
+ > .dropdown-menu {
124
+ display: block;
125
+ }
126
+
127
+ // Remove the outline when :focus is triggered
128
+ > a {
129
+ outline: 0;
130
+ }
131
+ }
132
+
133
+ // Dropdown section headers
134
+ .dropdown-header {
135
+ display: block;
136
+ padding: 3px 20px;
137
+ font-size: @font-size-small;
138
+ line-height: @line-height-base;
139
+ color: @dropdown-header-color;
140
+ }
141
+
142
+ // Backdrop to catch body clicks on mobile, etc.
143
+ .dropdown-backdrop {
144
+ position: fixed;
145
+ left: 0;
146
+ right: 0;
147
+ bottom: 0;
148
+ top: 0;
149
+ z-index: @zindex-dropdown - 10;
150
+ }
151
+
152
+ // Right aligned dropdowns
153
+ .pull-right > .dropdown-menu {
154
+ right: 0;
155
+ left: auto;
156
+ }
157
+
158
+ // Allow for dropdowns to go bottom up (aka, dropup-menu)
159
+ //
160
+ // Just add .dropup after the standard .dropdown class and you're set, bro.
161
+ // TODO: abstract this so that the navbar fixed styles are not placed here?
162
+
163
+ .dropup,
164
+ .navbar-fixed-bottom .dropdown {
165
+ // Reverse the caret
166
+ .caret {
167
+ // Firefox fix for https://github.com/twbs/bootstrap/issues/9538. Once this
168
+ // gets fixed, restore `border-top: 0;`.
169
+ border-top: 0 dotted;
170
+ border-bottom: 4px solid @dropdown-caret-color;
171
+ content: "";
172
+ }
173
+ // Different positioning for bottom up menu
174
+ .dropdown-menu {
175
+ top: auto;
176
+ bottom: 100%;
177
+ margin-bottom: 1px;
178
+ }
179
+ }
180
+
181
+
182
+ // Component alignment
183
+ //
184
+ // Reiterate per navbar.less and the modified component alignment there.
185
+
186
+ @media (min-width: @grid-float-breakpoint) {
187
+ .navbar-right {
188
+ .dropdown-menu {
189
+ .pull-right > .dropdown-menu();
190
+ }
191
+ }
192
+ }
193
+
@@ -0,0 +1,362 @@
1
+ //
2
+ // Forms
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Normalize non-controls
7
+ //
8
+ // Restyle and baseline non-control form elements.
9
+
10
+ fieldset {
11
+ padding: 0;
12
+ margin: 0;
13
+ border: 0;
14
+ }
15
+
16
+ legend {
17
+ display: block;
18
+ width: 100%;
19
+ padding: 0;
20
+ margin-bottom: @line-height-computed;
21
+ font-size: (@font-size-base * 1.5);
22
+ line-height: inherit;
23
+ color: @legend-color;
24
+ border: 0;
25
+ border-bottom: 1px solid @legend-border-color;
26
+ }
27
+
28
+ label {
29
+ display: inline-block;
30
+ margin-bottom: 5px;
31
+ font-weight: bold;
32
+ }
33
+
34
+
35
+ // Normalize form controls
36
+
37
+ // Override content-box in Normalize (* isn't specific enough)
38
+ input[type="search"] {
39
+ .box-sizing(border-box);
40
+ }
41
+
42
+ // Position radios and checkboxes better
43
+ input[type="radio"],
44
+ input[type="checkbox"] {
45
+ margin: 4px 0 0;
46
+ margin-top: 1px \9; /* IE8-9 */
47
+ line-height: normal;
48
+ }
49
+
50
+ // Set the height of select and file controls to match text inputs
51
+ input[type="file"] {
52
+ display: block;
53
+ }
54
+
55
+ // Make multiple select elements height not fixed
56
+ select[multiple],
57
+ select[size] {
58
+ height: auto;
59
+ }
60
+
61
+ // Fix optgroup Firefox bug per https://github.com/twbs/bootstrap/issues/7611
62
+ select optgroup {
63
+ font-size: inherit;
64
+ font-style: inherit;
65
+ font-family: inherit;
66
+ }
67
+
68
+ // Focus for select, file, radio, and checkbox
69
+ input[type="file"]:focus,
70
+ input[type="radio"]:focus,
71
+ input[type="checkbox"]:focus {
72
+ .tab-focus();
73
+ }
74
+
75
+ // Fix for Chrome number input
76
+ // Setting certain font-sizes causes the `I` bar to appear on hover of the bottom increment button.
77
+ // See https://github.com/twbs/bootstrap/issues/8350 for more.
78
+ input[type="number"] {
79
+ &::-webkit-outer-spin-button,
80
+ &::-webkit-inner-spin-button {
81
+ height: auto;
82
+ }
83
+ }
84
+
85
+ // Adjust output element
86
+ output {
87
+ display: block;
88
+ padding-top: (@padding-base-vertical + 1);
89
+ font-size: @font-size-base;
90
+ line-height: @line-height-base;
91
+ color: @input-color;
92
+ vertical-align: middle;
93
+ }
94
+
95
+ // Placeholder
96
+ //
97
+ // Placeholder text gets special styles because when browsers invalidate entire
98
+ // lines if it doesn't understand a selector/
99
+ .form-control {
100
+ .placeholder();
101
+ }
102
+
103
+
104
+ // Common form controls
105
+ //
106
+ // Shared size and type resets for form controls. Apply `.form-control` to any
107
+ // of the following form controls:
108
+ //
109
+ // select
110
+ // textarea
111
+ // input[type="text"]
112
+ // input[type="password"]
113
+ // input[type="datetime"]
114
+ // input[type="datetime-local"]
115
+ // input[type="date"]
116
+ // input[type="month"]
117
+ // input[type="time"]
118
+ // input[type="week"]
119
+ // input[type="number"]
120
+ // input[type="email"]
121
+ // input[type="url"]
122
+ // input[type="search"]
123
+ // input[type="tel"]
124
+ // input[type="color"]
125
+
126
+ .form-control {
127
+ display: block;
128
+ width: 100%;
129
+ height: @input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
130
+ padding: @padding-base-vertical @padding-base-horizontal;
131
+ font-size: @font-size-base;
132
+ line-height: @line-height-base;
133
+ color: @input-color;
134
+ vertical-align: middle;
135
+ background-color: @input-bg;
136
+ border: 1px solid @input-border;
137
+ border-radius: @input-border-radius;
138
+ .box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
139
+ .transition(~"border-color ease-in-out .15s, box-shadow ease-in-out .15s");
140
+
141
+ // Customize the `:focus` state to imitate native WebKit styles.
142
+ .form-control-focus();
143
+
144
+ // Disabled and read-only inputs
145
+ // Note: HTML5 says that controls under a fieldset > legend:first-child won't
146
+ // be disabled if the fieldset is disabled. Due to implementation difficulty,
147
+ // we don't honor that edge case; we style them as disabled anyway.
148
+ &[disabled],
149
+ &[readonly],
150
+ fieldset[disabled] & {
151
+ cursor: not-allowed;
152
+ background-color: @input-bg-disabled;
153
+ }
154
+
155
+ // Reset height for `textarea`s
156
+ textarea& {
157
+ height: auto;
158
+ }
159
+ }
160
+
161
+
162
+ // Form groups
163
+ //
164
+ // Designed to help with the organization and spacing of vertical forms. For
165
+ // horizontal forms, use the predefined grid classes.
166
+
167
+ .form-group {
168
+ margin-bottom: 15px;
169
+ }
170
+
171
+
172
+ // Checkboxes and radios
173
+ //
174
+ // Indent the labels to position radios/checkboxes as hanging controls.
175
+
176
+ .radio,
177
+ .checkbox {
178
+ display: block;
179
+ min-height: @line-height-computed; // clear the floating input if there is no label text
180
+ margin-top: 10px;
181
+ margin-bottom: 10px;
182
+ padding-left: 20px;
183
+ vertical-align: middle;
184
+ label {
185
+ display: inline;
186
+ margin-bottom: 0;
187
+ font-weight: normal;
188
+ cursor: pointer;
189
+ }
190
+ }
191
+ .radio input[type="radio"],
192
+ .radio-inline input[type="radio"],
193
+ .checkbox input[type="checkbox"],
194
+ .checkbox-inline input[type="checkbox"] {
195
+ float: left;
196
+ margin-left: -20px;
197
+ }
198
+ .radio + .radio,
199
+ .checkbox + .checkbox {
200
+ margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing
201
+ }
202
+
203
+ // Radios and checkboxes on same line
204
+ .radio-inline,
205
+ .checkbox-inline {
206
+ display: inline-block;
207
+ padding-left: 20px;
208
+ margin-bottom: 0;
209
+ vertical-align: middle;
210
+ font-weight: normal;
211
+ cursor: pointer;
212
+ }
213
+ .radio-inline + .radio-inline,
214
+ .checkbox-inline + .checkbox-inline {
215
+ margin-top: 0;
216
+ margin-left: 10px; // space out consecutive inline controls
217
+ }
218
+
219
+ // Apply same disabled cursor tweak as for inputs
220
+ //
221
+ // Note: Neither radios nor checkboxes can be readonly.
222
+ input[type="radio"],
223
+ input[type="checkbox"],
224
+ .radio,
225
+ .radio-inline,
226
+ .checkbox,
227
+ .checkbox-inline {
228
+ &[disabled],
229
+ fieldset[disabled] & {
230
+ cursor: not-allowed;
231
+ }
232
+ }
233
+
234
+ // Form control sizing
235
+ .input-sm {
236
+ .input-size(@input-height-small; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);
237
+ }
238
+
239
+ .input-lg {
240
+ .input-size(@input-height-large; @padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);
241
+ }
242
+
243
+
244
+ // Form control feedback states
245
+ //
246
+ // Apply contextual and semantic states to individual form controls.
247
+
248
+ // Warning
249
+ .has-warning {
250
+ .form-control-validation(@state-warning-text; @state-warning-text; @state-warning-bg);
251
+ }
252
+ // Error
253
+ .has-error {
254
+ .form-control-validation(@state-danger-text; @state-danger-text; @state-danger-bg);
255
+ }
256
+ // Success
257
+ .has-success {
258
+ .form-control-validation(@state-success-text; @state-success-text; @state-success-bg);
259
+ }
260
+
261
+
262
+ // Static form control text
263
+ //
264
+ // Apply class to a `p` element to make any string of text align with labels in
265
+ // a horizontal form layout.
266
+
267
+ .form-control-static {
268
+ margin-bottom: 0; // Remove default margin from `p`
269
+ padding-top: (@padding-base-vertical + 1);
270
+ }
271
+
272
+
273
+ // Help text
274
+ //
275
+ // Apply to any element you wish to create light text for placement immediately
276
+ // below a form control. Use for general help, formatting, or instructional text.
277
+
278
+ .help-block {
279
+ display: block; // account for any element using help-block
280
+ margin-top: 5px;
281
+ margin-bottom: 10px;
282
+ color: lighten(@text-color, 25%); // lighten the text some for contrast
283
+ }
284
+
285
+
286
+
287
+ // Inline forms
288
+ //
289
+ // Make forms appear inline(-block) by adding the `.form-inline` class. Inline
290
+ // forms begin stacked on extra small (mobile) devices and then go inline when
291
+ // viewports reach <768px.
292
+ //
293
+ // Requires wrapping inputs and labels with `.form-group` for proper display of
294
+ // default HTML form controls and our custom form controls (e.g., input groups).
295
+ //
296
+ // Heads up! This is mixin-ed into `.navbar-form` in navbars.less.
297
+
298
+ .form-inline {
299
+
300
+ // Kick in the inline
301
+ @media (min-width: @screen-sm) {
302
+ // Inline-block all the things for "inline"
303
+ .form-group {
304
+ display: inline-block;
305
+ margin-bottom: 0;
306
+ vertical-align: middle;
307
+ }
308
+
309
+ // In navbar-form, allow folks to *not* use `.form-group`
310
+ .form-control {
311
+ display: inline-block;
312
+ }
313
+
314
+ // Remove default margin on radios/checkboxes that were used for stacking, and
315
+ // then undo the floating of radios and checkboxes to match (which also avoids
316
+ // a bug in WebKit: https://github.com/twbs/bootstrap/issues/1969).
317
+ .radio,
318
+ .checkbox {
319
+ display: inline-block;
320
+ margin-top: 0;
321
+ margin-bottom: 0;
322
+ padding-left: 0;
323
+ }
324
+ .radio input[type="radio"],
325
+ .checkbox input[type="checkbox"] {
326
+ float: none;
327
+ margin-left: 0;
328
+ }
329
+ }
330
+ }
331
+
332
+
333
+ // Horizontal forms
334
+ //
335
+ // Horizontal forms are built on grid classes and allow you to create forms with
336
+ // labels on the left and inputs on the right.
337
+
338
+ .form-horizontal {
339
+
340
+ // Consistent vertical alignment of labels, radios, and checkboxes
341
+ .control-label,
342
+ .radio,
343
+ .checkbox,
344
+ .radio-inline,
345
+ .checkbox-inline {
346
+ margin-top: 0;
347
+ margin-bottom: 0;
348
+ padding-top: (@padding-base-vertical + 1); // Default padding plus a border
349
+ }
350
+
351
+ // Make form groups behave like rows
352
+ .form-group {
353
+ .make-row();
354
+ }
355
+
356
+ // Only right align form labels here when the columns stop stacking
357
+ @media (min-width: @screen-sm) {
358
+ .control-label {
359
+ text-align: right;
360
+ }
361
+ }
362
+ }