compass_twitter_bootstrap 0.1.8 → 2.0.0

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 (96) hide show
  1. data/CHANGELOG.md +6 -0
  2. data/README.md +14 -8
  3. data/build/convert.rb +58 -33
  4. data/lib/compass_twitter_bootstrap.rb +1 -1
  5. data/lib/compass_twitter_bootstrap/version.rb +1 -1
  6. data/stylesheets/_compass_twitter_bootstrap.scss +45 -7
  7. data/stylesheets/_compass_twitter_bootstrap_responsive.scss +322 -0
  8. data/stylesheets/compass_twitter_bootstrap/_accordion.scss +28 -0
  9. data/stylesheets/compass_twitter_bootstrap/_alerts.scss +70 -0
  10. data/stylesheets/compass_twitter_bootstrap/_breadcrumbs.scss +22 -0
  11. data/stylesheets/compass_twitter_bootstrap/_button-groups.scss +147 -0
  12. data/stylesheets/compass_twitter_bootstrap/_buttons.scss +165 -0
  13. data/stylesheets/compass_twitter_bootstrap/_carousel.scss +121 -0
  14. data/stylesheets/compass_twitter_bootstrap/_close.scss +18 -0
  15. data/stylesheets/compass_twitter_bootstrap/_code.scss +44 -0
  16. data/stylesheets/compass_twitter_bootstrap/_component-animations.scss +18 -0
  17. data/stylesheets/compass_twitter_bootstrap/_dropdowns.scss +131 -0
  18. data/stylesheets/compass_twitter_bootstrap/_forms.scss +335 -299
  19. data/stylesheets/compass_twitter_bootstrap/_grid.scss +8 -0
  20. data/stylesheets/compass_twitter_bootstrap/_hero-unit.scss +20 -0
  21. data/stylesheets/compass_twitter_bootstrap/_labels.scss +16 -0
  22. data/stylesheets/compass_twitter_bootstrap/_layouts.scss +17 -0
  23. data/stylesheets/compass_twitter_bootstrap/_mixins.scss +409 -68
  24. data/stylesheets/compass_twitter_bootstrap/_modals.scss +72 -0
  25. data/stylesheets/compass_twitter_bootstrap/_navbar.scss +292 -0
  26. data/stylesheets/compass_twitter_bootstrap/_navs.scss +344 -0
  27. data/stylesheets/compass_twitter_bootstrap/_pager.scss +30 -0
  28. data/stylesheets/compass_twitter_bootstrap/_pagination.scss +55 -0
  29. data/stylesheets/compass_twitter_bootstrap/_popovers.scss +49 -0
  30. data/stylesheets/compass_twitter_bootstrap/_progress-bars.scss +95 -0
  31. data/stylesheets/compass_twitter_bootstrap/_reset.scss +37 -52
  32. data/stylesheets/compass_twitter_bootstrap/_scaffolding.scss +13 -123
  33. data/stylesheets/compass_twitter_bootstrap/_sprites.scss +156 -0
  34. data/stylesheets/compass_twitter_bootstrap/_tables.scss +75 -160
  35. data/stylesheets/compass_twitter_bootstrap/_thumbnails.scss +35 -0
  36. data/stylesheets/compass_twitter_bootstrap/_tooltip.scss +35 -0
  37. data/stylesheets/compass_twitter_bootstrap/_type.scss +100 -70
  38. data/stylesheets/compass_twitter_bootstrap/_utilities.scss +23 -0
  39. data/stylesheets/compass_twitter_bootstrap/_variables.scss +94 -55
  40. data/stylesheets/compass_twitter_bootstrap/_wells.scss +17 -0
  41. data/stylesheets_sass/_compass_twitter_bootstrap.sass +49 -6
  42. data/stylesheets_sass/_compass_twitter_bootstrap_responsive.sass +252 -0
  43. data/stylesheets_sass/compass_twitter_bootstrap/_accordion.sass +24 -0
  44. data/stylesheets_sass/compass_twitter_bootstrap/_alerts.sass +65 -0
  45. data/stylesheets_sass/compass_twitter_bootstrap/_breadcrumbs.sass +18 -0
  46. data/stylesheets_sass/compass_twitter_bootstrap/_button-groups.sass +129 -0
  47. data/stylesheets_sass/compass_twitter_bootstrap/_buttons.sass +150 -0
  48. data/stylesheets_sass/compass_twitter_bootstrap/_carousel.sass +95 -0
  49. data/stylesheets_sass/compass_twitter_bootstrap/_close.sass +16 -0
  50. data/stylesheets_sass/compass_twitter_bootstrap/_code.sass +41 -0
  51. data/stylesheets_sass/compass_twitter_bootstrap/_component-animations.sass +16 -0
  52. data/stylesheets_sass/compass_twitter_bootstrap/_dropdowns.sass +121 -0
  53. data/stylesheets_sass/compass_twitter_bootstrap/_forms.sass +327 -306
  54. data/stylesheets_sass/compass_twitter_bootstrap/_grid.sass +8 -0
  55. data/stylesheets_sass/compass_twitter_bootstrap/_hero-unit.sass +17 -0
  56. data/stylesheets_sass/compass_twitter_bootstrap/_labels.sass +23 -0
  57. data/stylesheets_sass/compass_twitter_bootstrap/_layouts.sass +14 -0
  58. data/stylesheets_sass/compass_twitter_bootstrap/_mixins.sass +425 -57
  59. data/stylesheets_sass/compass_twitter_bootstrap/_modals.sass +75 -0
  60. data/stylesheets_sass/compass_twitter_bootstrap/_navbar.sass +258 -0
  61. data/stylesheets_sass/compass_twitter_bootstrap/_navs.sass +316 -0
  62. data/stylesheets_sass/compass_twitter_bootstrap/_pager.sass +29 -0
  63. data/stylesheets_sass/compass_twitter_bootstrap/_pagination.sass +53 -0
  64. data/stylesheets_sass/compass_twitter_bootstrap/_popovers.sass +55 -0
  65. data/stylesheets_sass/compass_twitter_bootstrap/_progress-bars.sass +89 -0
  66. data/stylesheets_sass/compass_twitter_bootstrap/_reset.sass +33 -67
  67. data/stylesheets_sass/compass_twitter_bootstrap/_scaffolding.sass +13 -175
  68. data/stylesheets_sass/compass_twitter_bootstrap/_sprites.sass +392 -0
  69. data/stylesheets_sass/compass_twitter_bootstrap/_tables.sass +67 -139
  70. data/stylesheets_sass/compass_twitter_bootstrap/_thumbnails.sass +34 -0
  71. data/stylesheets_sass/compass_twitter_bootstrap/_tooltip.sass +43 -0
  72. data/stylesheets_sass/compass_twitter_bootstrap/_type.sass +95 -65
  73. data/stylesheets_sass/compass_twitter_bootstrap/_utilities.sass +20 -0
  74. data/stylesheets_sass/compass_twitter_bootstrap/_variables.sass +67 -45
  75. data/stylesheets_sass/compass_twitter_bootstrap/_wells.sass +15 -0
  76. data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
  77. data/vendor/assets/images/glyphicons-halflings.png +0 -0
  78. data/vendor/assets/javascripts/bootstrap-alert.js +91 -0
  79. data/vendor/assets/javascripts/bootstrap-button.js +98 -0
  80. data/vendor/assets/javascripts/bootstrap-carousel.js +154 -0
  81. data/vendor/assets/javascripts/bootstrap-collapse.js +136 -0
  82. data/vendor/assets/javascripts/bootstrap-dropdown.js +58 -21
  83. data/vendor/assets/javascripts/bootstrap-modal.js +63 -114
  84. data/vendor/assets/javascripts/bootstrap-popover.js +38 -33
  85. data/vendor/assets/javascripts/bootstrap-scrollspy.js +62 -44
  86. data/vendor/assets/javascripts/bootstrap-tab.js +130 -0
  87. data/vendor/assets/javascripts/bootstrap-tooltip.js +270 -0
  88. data/vendor/assets/javascripts/bootstrap-transition.js +51 -0
  89. data/vendor/assets/javascripts/bootstrap-typeahead.js +271 -0
  90. metadata +69 -17
  91. data/stylesheets/compass_twitter_bootstrap/_patterns.scss +0 -1058
  92. data/stylesheets_sass/compass_twitter_bootstrap/_patterns.sass +0 -923
  93. data/vendor/assets/javascripts/bootstrap-alerts.js +0 -124
  94. data/vendor/assets/javascripts/bootstrap-buttons.js +0 -64
  95. data/vendor/assets/javascripts/bootstrap-tabs.js +0 -80
  96. data/vendor/assets/javascripts/bootstrap-twipsy.js +0 -321
@@ -0,0 +1,121 @@
1
+ // DROPDOWN MENUS
2
+ // --------------
3
+
4
+ // Use the .menu class on any <li> element within the topbar or ul.tabs and you'll get some superfancy dropdowns
5
+ .dropdown
6
+ position: relative
7
+
8
+ .dropdown-toggle
9
+ // The caret makes the toggle a bit too tall in IE7
10
+ *margin-bottom: -3px
11
+
12
+ .dropdown-toggle:active,
13
+ .open .dropdown-toggle
14
+ outline: 0
15
+
16
+ // Dropdown arrow/caret
17
+ .caret
18
+ display: inline-block
19
+ width: 0
20
+ height: 0
21
+ text-indent: -99999px
22
+ // IE7 won't do the border trick if there's a text indent, but it doesn't
23
+ // do the content that text-indent is hiding, either, so we're ok.
24
+ *text-indent: 0
25
+ vertical-align: top
26
+ border-left: 4px solid transparent
27
+ border-right: 4px solid transparent
28
+ border-top: 4px solid $black
29
+ +opacity(0.3)
30
+ content: "\2193"
31
+
32
+ .dropdown .caret
33
+ margin-top: 8px
34
+ margin-left: 2px
35
+
36
+ .dropdown:hover .caret,
37
+ .open.dropdown .caret
38
+ +opacity(1)
39
+
40
+ // The dropdown menu (ul)
41
+ .dropdown-menu
42
+ position: absolute
43
+ top: 100%
44
+ left: 0
45
+ z-index: $zindexDropdown
46
+ float: left
47
+ display: none
48
+ // none by default, but block on "open" of the menu
49
+ min-width: 160px
50
+ max-width: 220px
51
+ _width: 160px
52
+ padding: 4px 0
53
+ margin: 0
54
+ // override default ul
55
+ list-style: none
56
+ background-color: $white
57
+ border-color: #ccc
58
+ border-color: rgba(0, 0, 0, 0.2)
59
+ border-style: solid
60
+ border-width: 1px
61
+ +border-radius(0 0 5px 5px)
62
+ +box-shadow(0 5px 10px rgba(0, 0, 0, 0.2))
63
+ -webkit-background-clip: padding-box
64
+ -moz-background-clip: padding
65
+ background-clip: padding-box
66
+ *border-right-width: 2px
67
+ *border-bottom-width: 2px
68
+ // Allow for dropdowns to go bottom up (aka, dropup-menu)
69
+ &.bottom-up
70
+ top: auto
71
+ bottom: 100%
72
+ margin-bottom: 2px
73
+ // Dividers (basically an hr) within the dropdown
74
+ .divider
75
+ height: 1px
76
+ margin: 5px 1px
77
+ overflow: hidden
78
+ background-color: #e5e5e5
79
+ border-bottom: 1px solid $white
80
+ // IE7 needs a set width since we gave a height. Restricting just
81
+ // to IE7 to keep the 1px left/right space in other browsers.
82
+ // It is unclear where IE is getting the extra space that we need
83
+ // to negative-margin away, but so it goes.
84
+ *width: 100%
85
+ *margin: -5px 0 5px
86
+ // Links within the dropdown menu
87
+ a
88
+ display: block
89
+ padding: 3px 15px
90
+ clear: both
91
+ font-weight: normal
92
+ line-height: 18px
93
+ color: $gray
94
+ white-space: nowrap
95
+
96
+ // Hover state
97
+
98
+ .dropdown-menu li > a:hover,
99
+ .dropdown-menu .active > a,
100
+ .dropdown-menu .active > a:hover
101
+ color: $white
102
+ text-decoration: none
103
+ background-color: $linkColor
104
+
105
+ // Open state for the dropdown
106
+ .dropdown.open
107
+ // IE7's z-index only goes to the nearest positioned ancestor, which would
108
+ // make the menu appear below buttons that appeared later on the page
109
+ *z-index: $zindexDropdown
110
+ .dropdown-toggle
111
+ color: $white
112
+ background: #ccc
113
+ background: rgba(0, 0, 0, 0.3)
114
+ .dropdown-menu
115
+ display: block
116
+
117
+ // Typeahead
118
+ .typeahead
119
+ margin-top: 2px
120
+ // give it some space to breathe
121
+ +border-radius(4px)
@@ -1,61 +1,46 @@
1
- /* Forms.less
2
- * Base styles for various input types, form layouts, and states
3
- * -------------------------------------------------------------
1
+ // Forms.less
2
+ // Base styles for various input types, form layouts, and states
3
+ // -------------------------------------------------------------
4
4
 
5
- // FORM STYLES
6
- // -----------
5
+ // GENERAL STYLES
6
+ // --------------
7
7
 
8
+ // Make all forms have space below them
8
9
  form
9
- margin-bottom: $baseline
10
+ margin: 0 0 $baseLineHeight
10
11
 
11
- // Groups of fields with labels on top (legends)
12
12
  fieldset
13
- margin-bottom: $baseline
14
- padding-top: $baseline
15
- legend
16
- display: block
17
- padding-left: 150px
18
- font-size: $basefont * 1.5
19
- line-height: 1
20
- color: $grayDark
21
- *padding: 0 0 5px 145px
22
- /* IE6-7
23
- *line-height: 1.5
24
- /* IE6-7
13
+ padding: 0
14
+ margin: 0
15
+ border: 0
25
16
 
26
- // Parent element that clears floats and wraps labels and fields together
27
- form .clearfix
28
- margin-bottom: $baseline
29
- +clearfix
17
+ // Groups of fields with labels on top (legends)
18
+ legend
19
+ display: block
20
+ width: 100%
21
+ padding: 0
22
+ margin-bottom: $baseLineHeight * 1.5
23
+ font-size: $baseFontSize * 1.5
24
+ line-height: $baseLineHeight * 2
25
+ color: $grayDark
26
+ border: 0
27
+ border-bottom: 1px solid #eee
30
28
 
31
29
  // Set font for forms
32
30
 
33
31
  label,
34
32
  input,
33
+ button,
35
34
  select,
36
35
  textarea
37
- +sans-serif(normal, 13px, normal)
36
+ +font-sans-serif($baseFontSize, normal, $baseLineHeight)
38
37
 
39
- // Float labels left
38
+ // Identify controls by their labels
40
39
  label
41
- padding-top: 6px
42
- font-size: $basefont
43
- line-height: $baseline
44
- float: left
45
- width: 130px
46
- text-align: right
40
+ display: block
41
+ margin-bottom: 5px
47
42
  color: $grayDark
48
43
 
49
- // Shift over the inside div to align all label's relevant content
50
- form .input
51
- margin-left: 150px
52
-
53
- // Checkboxs and radio buttons
54
-
55
- input[type=checkbox],
56
- input[type=radio]
57
- cursor: pointer
58
-
59
44
  // Inputs, Textareas, Selects
60
45
 
61
46
  input,
@@ -64,100 +49,208 @@ select,
64
49
  .uneditable-input
65
50
  display: inline-block
66
51
  width: 210px
67
- height: $baseline
52
+ height: $baseLineHeight
68
53
  padding: 4px
69
- font-size: $basefont
70
- line-height: $baseline
54
+ margin-bottom: 9px
55
+ font-size: $baseFontSize
56
+ line-height: $baseLineHeight
71
57
  color: $gray
72
58
  border: 1px solid #ccc
73
59
  +border-radius(3px)
74
60
 
75
- // remove padding from select
76
- select
77
- padding: initial
61
+ .uneditable-textarea
62
+ width: auto
63
+ height: auto
78
64
 
79
- // mini reset for non-html5 file types
65
+ // Inputs within a label
80
66
 
81
- input[type=checkbox],
82
- input[type=radio]
67
+ label input,
68
+ label textarea,
69
+ label select
70
+ display: block
71
+
72
+ // Mini reset for unique input types
73
+
74
+ input[type="image"],
75
+ input[type="checkbox"],
76
+ input[type="radio"]
83
77
  width: auto
84
78
  height: auto
85
79
  padding: 0
86
80
  margin: 3px 0
87
81
  *margin-top: 0
88
- /* IE6-7
82
+ /* IE7
89
83
  line-height: normal
90
- border: none
84
+ border: 0
85
+ cursor: pointer
86
+ +border-radius(0)
91
87
 
92
- input[type=file]
93
- background-color: $white
88
+ // Reset the file input to browser defaults
89
+ input[type="file"]
94
90
  padding: initial
95
- border: initial
96
91
  line-height: initial
92
+ border: initial
93
+ background-color: $white
94
+ background-color: initial
97
95
  +box-shadow(none)
98
96
 
99
- input[type=button],
100
- input[type=reset],
101
- input[type=submit]
97
+ // Help out input buttons
98
+
99
+ input[type="button"],
100
+ input[type="reset"],
101
+ input[type="submit"]
102
102
  width: auto
103
103
  height: auto
104
104
 
105
+ // Set the height of select and file controls to match text inputs
106
+
105
107
  select,
106
- input[type=file]
107
- height: $baseline * 1.5
108
- // In IE7, the height of the select element cannot be changed by height, only font-size
109
- *height: auto
110
- // Reset for IE7
111
- line-height: $baseline * 1.5
108
+ input[type="file"]
109
+ height: 28px
110
+ /* In IE7, the height of the select element cannot be changed by height, only font-size
112
111
  *margin-top: 4px
113
112
  /* For IE7, add top margin to align select with labels
113
+ line-height: 28px
114
114
 
115
- // Make multiple select elements height not fixed
116
- select[multiple]
117
- height: inherit
115
+ // Chrome on Linux and Mobile Safari need background-color
116
+ select
117
+ width: 220px
118
+ // default input width + 10px of padding that doesn't get applied
118
119
  background-color: $white
119
- // Fixes Chromium bug of unreadable items
120
120
 
121
+ // Make multiple select elements height not fixed
122
+
123
+ select[multiple],
124
+ select[size]
125
+ height: auto
126
+
127
+ // Remove shadow from image inputs
128
+ input[type="image"]
129
+ +box-shadow(none)
130
+
131
+ // Make textarea height behave
121
132
  textarea
122
133
  height: auto
123
134
 
124
- // For text that needs to appear as an input but should not be an input
125
- .uneditable-input
126
- background-color: $white
127
- display: block
128
- border-color: #eee
129
- +box-shadow(inset 0 1px 2px rgba(0, 0, 0, 0.025))
130
- cursor: not-allowed
135
+ // Hidden inputs
136
+ input[type="hidden"]
137
+ display: none
131
138
 
132
- // Placeholder text gets special styles; can't be bundled together though for some reason
133
- \:-moz-placeholder
134
- color: $grayLight
139
+ // CHECKBOXES & RADIOS
140
+ // -------------------
135
141
 
136
- \::-webkit-input-placeholder
137
- color: $grayLight
142
+ // Indent the labels to position radios/checkboxes as hanging
143
+
144
+ .radio,
145
+ .checkbox
146
+ padding-left: 18px
138
147
 
139
- // Focus states
148
+ .radio input[type="radio"],
149
+ .checkbox input[type="checkbox"]
150
+ float: left
151
+ margin-left: -18px
152
+
153
+ // Move the options list down to align with labels
154
+
155
+ .controls > .radio:first-child,
156
+ .controls > .checkbox:first-child
157
+ padding-top: 5px
158
+ // has to be padding because margin collaspes
159
+
160
+ // Radios and checkboxes on same line
161
+
162
+ .radio.inline,
163
+ .checkbox.inline
164
+ display: inline-block
165
+ margin-bottom: 0
166
+ vertical-align: middle
167
+
168
+ .radio.inline + .radio.inline,
169
+ .checkbox.inline + .checkbox.inline
170
+ margin-left: 10px
171
+ // space out consecutive inline controls
172
+
173
+ // But don't forget to remove their padding on first-child
174
+
175
+ .controls > .radio.inline:first-child,
176
+ .controls > .checkbox.inline:first-child
177
+ padding-top: 0
178
+
179
+ // FOCUS STATE
180
+ // -----------
140
181
 
141
182
  input,
142
183
  textarea
184
+ +box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.075))
143
185
  $transition: border linear 0.2s, box-shadow linear 0.2s
144
186
  +transition($transition)
145
- +box-shadow(inset 0 1px 3px rgba(0, 0, 0, 0.1))
146
187
 
147
188
  input:focus,
148
189
  textarea:focus
149
- outline: 0
150
190
  border-color: rgba(82, 168, 236, 0.8)
151
- $shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6)
191
+ $shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6)
152
192
  +box-shadow($shadow)
193
+ outline: 0
194
+ outline: thin dotted \9
195
+ /* IE6-8
153
196
 
154
- input[type=file]:focus,
155
- input[type=checkbox]:focus,
197
+ input[type="file"]:focus,
198
+ input[type="checkbox"]:focus,
156
199
  select:focus
157
200
  +box-shadow(none)
158
201
  // override for file inputs
159
- outline: 1px dotted #666
160
- // Selet elements don't get box-shadow styles, so instead we do outline
202
+ +tab-focus
203
+
204
+ // INPUT SIZES
205
+ // -----------
206
+
207
+ // General classes for quick sizes
208
+ .input-mini
209
+ width: 60px
210
+
211
+ .input-small
212
+ width: 90px
213
+
214
+ .input-medium
215
+ width: 150px
216
+
217
+ .input-large
218
+ width: 210px
219
+
220
+ .input-xlarge
221
+ width: 270px
222
+
223
+ .input-xxlarge
224
+ width: 530px
225
+
226
+ // Grid style input sizes
227
+
228
+ input[class*="span"],
229
+ select[class*="span"],
230
+ textarea[class*="span"],
231
+ .uneditable-input
232
+ float: none
233
+ margin-left: 0
234
+
235
+ // GRID SIZING FOR INPUTS
236
+ // ----------------------
237
+
238
+ +inputGridSystem-generate($gridColumns, $gridColumnWidth, $gridGutterWidth)
239
+
240
+ // DISABLED STATE
241
+ // --------------
242
+
243
+ // Disabled and read-only inputs
244
+
245
+ input[disabled],
246
+ select[disabled],
247
+ textarea[disabled],
248
+ input[readonly],
249
+ select[readonly],
250
+ textarea[readonly]
251
+ background-color: #f5f5f5
252
+ border-color: #ddd
253
+ cursor: not-allowed
161
254
 
162
255
  // FORM FIELD FEEDBACK STATES
163
256
  // --------------------------
@@ -171,6 +264,7 @@ select:focus
171
264
  color: $textColor
172
265
  // Style inputs accordingly
173
266
  input,
267
+ select,
174
268
  textarea
175
269
  color: $textColor
176
270
  border-color: $borderColor
@@ -184,184 +278,102 @@ select:focus
184
278
  background-color: $backgroundColor
185
279
  border-color: $textColor
186
280
 
187
- // Error
188
- form .clearfix.error
189
- +formFieldState(#b94a48, #ee5f5b, lighten(#ee5f5b, 30%))
190
-
191
281
  // Warning
192
- form .clearfix.warning
193
- +formFieldState(#c09853, #ccae64, lighten(#ccae64, 5%))
282
+ .control-group.warning
283
+ +formFieldState($warningText, $warningText, $warningBackground)
194
284
 
195
- // Success
196
- form .clearfix.success
197
- +formFieldState(#468847, #57a957, lighten(#57a957, 30%))
198
-
199
- // Form element sizes
200
- // TODO v2: remove duplication here and just stick to .input-[size] in light of adding .spanN sizes
201
-
202
- .input-mini,
203
- input.mini,
204
- textarea.mini,
205
- select.mini
206
- width: 60px
207
-
208
- .input-small,
209
- input.small,
210
- textarea.small,
211
- select.small
212
- width: 90px
213
-
214
- .input-medium,
215
- input.medium,
216
- textarea.medium,
217
- select.medium
218
- width: 150px
219
-
220
- .input-large,
221
- input.large,
222
- textarea.large,
223
- select.large
224
- width: 210px
225
-
226
- .input-xlarge,
227
- input.xlarge,
228
- textarea.xlarge,
229
- select.xlarge
230
- width: 270px
231
-
232
- .input-xxlarge,
233
- input.xxlarge,
234
- textarea.xxlarge,
235
- select.xxlarge
236
- width: 530px
285
+ // Error
286
+ .control-group.error
287
+ +formFieldState($errorText, $errorText, $errorBackground)
237
288
 
238
- textarea.xxlarge
239
- overflow-y: auto
289
+ // Success
290
+ .control-group.success
291
+ +formFieldState($successText, $successText, $successBackground)
292
+
293
+ // HTML5 invalid states
294
+ // Shares styles with the .control-group.error above
295
+
296
+ input:focus:required:invalid,
297
+ textarea:focus:required:invalid,
298
+ select:focus:required:invalid
299
+ color: #b94a48
300
+ border-color: #ee5f5b
301
+ &:focus
302
+ border-color: darken(#ee5f5b, 10%)
303
+ +box-shadow(0 0 6px lighten(#ee5f5b, 20%))
304
+
305
+ // FORM ACTIONS
306
+ // ------------
307
+
308
+ .form-actions
309
+ padding: $baseLineHeight - 1 20px $baseLineHeight
310
+ margin-top: $baseLineHeight
311
+ margin-bottom: $baseLineHeight
312
+ background-color: #f5f5f5
313
+ border-top: 1px solid #ddd
240
314
 
241
- // Grid style input sizes
242
- // This is a duplication of the main grid @include columns(); mixin, but subtracts 10px to account for input padding and border
243
- =formColumns($columnSpan: 1)
244
- display: inline-block
245
- float: none
246
- width: $gridColumnWidth * $columnSpan + $gridGutterWidth * ($columnSpan - 1) - 10
247
- margin-left: 0
315
+ // For text that needs to appear as an input but should not be an input
316
+ .uneditable-input
317
+ display: block
318
+ background-color: $white
319
+ border-color: #eee
320
+ +box-shadow(inset 0 1px 2px rgba(0, 0, 0, 0.025))
321
+ cursor: not-allowed
248
322
 
249
- input,
250
- textarea
251
- // Default columns
252
- &.span1
253
- +formColumns(1)
254
- &.span2
255
- +formColumns(2)
256
- &.span3
257
- +formColumns(3)
258
- &.span4
259
- +formColumns(4)
260
- &.span5
261
- +formColumns(5)
262
- &.span6
263
- +formColumns(6)
264
- &.span7
265
- +formColumns(7)
266
- &.span8
267
- +formColumns(8)
268
- &.span9
269
- +formColumns(9)
270
- &.span10
271
- +formColumns(10)
272
- &.span11
273
- +formColumns(11)
274
- &.span12
275
- +formColumns(12)
276
- &.span13
277
- +formColumns(13)
278
- &.span14
279
- +formColumns(14)
280
- &.span15
281
- +formColumns(15)
282
- &.span16
283
- +formColumns(16)
323
+ // Placeholder text gets special styles; can't be bundled together though for some reason
324
+ +placeholder($grayLight)
284
325
 
285
- // Disabled and read-only inputs
326
+ // HELP TEXT
327
+ // ---------
286
328
 
287
- input[disabled],
288
- select[disabled],
289
- textarea[disabled],
290
- input[readonly],
291
- select[readonly],
292
- textarea[readonly]
293
- background-color: #f5f5f5
294
- border-color: #ddd
295
- cursor: not-allowed
296
-
297
- // Actions (the buttons)
298
- .actions
299
- background: #f5f5f5
300
- margin-top: $baseline
301
- margin-bottom: $baseline
302
- padding: $baseline - 1 20px $baseline 150px
303
- border-top: 1px solid #ddd
304
- +border-radius(0 0 3px 3px)
305
- .secondary-action
306
- float: right
307
- a
308
- line-height: 30px
309
- &:hover
310
- text-decoration: underline
311
-
312
- // Help Text
313
- // TODO: Do we need to set basefont and baseline here?
314
-
315
- .help-inline,
316
329
  .help-block
317
- font-size: $basefont
318
- line-height: $baseline
330
+ margin-top: 5px
331
+ margin-bottom: 0
319
332
  color: $grayLight
320
333
 
321
334
  .help-inline
335
+ display: inline-block
336
+ +ie7-inline-block
337
+ margin-bottom: 9px
338
+ vertical-align: middle
322
339
  padding-left: 5px
323
- *position: relative
324
- /* IE6-7
325
- *top: -5px
326
- /* IE6-7
327
340
 
328
- // Big blocks of help text
329
- .help-block
330
- display: block
331
- max-width: 600px
332
-
333
- // Inline Fields (input fields that appear as inline objects
334
- .inline-inputs
335
- color: $gray
336
- span
337
- padding: 0 2px 0 1px
341
+ // INPUT GROUPS
342
+ // ------------
338
343
 
339
344
  // Allow us to put symbols and text within the input field for a cleaner look
340
345
 
341
346
  .input-prepend,
342
347
  .input-append
343
- input
348
+ margin-bottom: 5px
349
+ +clearfix
350
+ // Clear the float to prevent wrapping
351
+ input,
352
+ .uneditable-input
344
353
  +border-radius(0 3px 3px 0)
354
+ &:focus
355
+ position: relative
356
+ z-index: 2
357
+ .uneditable-input
358
+ border-left-color: #ccc
345
359
  .add-on
346
- position: relative
347
- background: #f5f5f5
348
- border: 1px solid #ccc
349
- z-index: 2
350
360
  float: left
351
361
  display: block
352
362
  width: auto
353
363
  min-width: 16px
354
- height: 18px
355
- padding: 4px 4px 4px 5px
364
+ height: $baseLineHeight
356
365
  margin-right: -1px
366
+ padding: 4px 5px
357
367
  font-weight: normal
358
- line-height: 18px
368
+ line-height: $baseLineHeight
359
369
  color: $grayLight
360
370
  text-align: center
361
371
  text-shadow: 0 1px 0 $white
372
+ background-color: #f5f5f5
373
+ border: 1px solid #ccc
362
374
  +border-radius(3px 0 0 3px)
363
375
  .active
364
- background: lighten($green, 30)
376
+ background-color: lighten($green, 30)
365
377
  border-color: $green
366
378
 
367
379
  .input-prepend
@@ -370,82 +382,91 @@ textarea[readonly]
370
382
  /* IE6-7
371
383
 
372
384
  .input-append
373
- input
385
+ input,
386
+ .uneditable-input
374
387
  float: left
375
388
  +border-radius(3px 0 0 3px)
389
+ .uneditable-input
390
+ border-right-color: #ccc
376
391
  .add-on
377
- +border-radius(0 3px 3px 0)
378
392
  margin-right: 0
379
393
  margin-left: -1px
394
+ +border-radius(0 3px 3px 0)
395
+ input:first-child
396
+ // In IE7, having a hasLayout container (from clearfix's zoom:1) can make the first input
397
+ // inherit the sum of its ancestors' margins.
398
+ *margin-left: -160px
399
+ & + .add-on
400
+ *margin-left: -21px
401
+
402
+ // SEARCH FORM
403
+ // -----------
380
404
 
381
- // Stacked options for forms (radio buttons or checkboxes)
382
- .inputs-list
383
- margin: 0 0 5px
384
- width: 100%
385
- li
386
- display: block
387
- padding: 0
388
- width: 100%
389
- label
390
- display: block
391
- float: none
392
- width: auto
393
- padding: 0
394
- margin-left: 20px
395
- line-height: $baseline
396
- text-align: left
397
- white-space: normal
398
- strong
399
- color: $gray
400
- small
401
- font-size: $basefont - 2
402
- font-weight: normal
403
- .inputs-list
404
- margin-left: 25px
405
- margin-bottom: 10px
406
- padding-top: 0
407
- &:first-child
408
- padding-top: 6px
409
- li + li
410
- padding-top: 2px
411
- input[type=radio],
412
- input[type=checkbox]
413
- margin-bottom: 0
414
- margin-left: -20px
415
- float: left
405
+ .search-query
406
+ padding-left: 14px
407
+ padding-right: 14px
408
+ margin-bottom: 0
409
+ // remove the default margin on all inputs
410
+ +border-radius(14px)
416
411
 
417
- // Stacked forms
418
- .form-stacked
419
- padding-left: 20px
420
- fieldset
421
- padding-top: $baseline / 2
422
- legend
423
- padding-left: 0
424
- label
425
- display: block
426
- float: none
427
- width: auto
428
- font-weight: bold
429
- text-align: left
430
- line-height: 20px
431
- padding-top: 0
432
- .clearfix
433
- margin-bottom: $baseline / 2
434
- div.input
435
- margin-left: 0
436
- .inputs-list
412
+ // HORIZONTAL & VERTICAL FORMS
413
+ // ---------------------------
414
+
415
+ // Common properties
416
+ // -----------------
417
+
418
+ .form-search,
419
+ .form-inline,
420
+ .form-horizontal
421
+ input,
422
+ textarea,
423
+ select,
424
+ .help-inline,
425
+ .uneditable-input
426
+ display: inline-block
437
427
  margin-bottom: 0
438
- li
439
- padding-top: 0
440
- label
441
- font-weight: normal
442
- padding-top: 0
443
- div.clearfix.error
444
- padding-top: 10px
445
- padding-bottom: 10px
446
- padding-left: 10px
447
- margin-top: 0
448
- margin-left: -10px
449
- .actions
450
- margin-left: -20px
451
- padding-left: 20px
428
+
429
+ .form-search label,
430
+ .form-inline label,
431
+ .form-search .input-append,
432
+ .form-inline .input-append,
433
+ .form-search .input-prepend,
434
+ .form-inline .input-prepend
435
+ display: inline-block
436
+
437
+ // Make the prepend and append add-on vertical-align: middle;
438
+
439
+ .form-search .input-append .add-on,
440
+ .form-inline .input-prepend .add-on,
441
+ .form-search .input-append .add-on,
442
+ .form-inline .input-prepend .add-on
443
+ vertical-align: middle
444
+
445
+ // Margin to space out fieldsets
446
+ .control-group
447
+ margin-bottom: $baseLineHeight / 2
448
+
449
+ // Horizontal-specific styles
450
+ // --------------------------
451
+
452
+ .form-horizontal
453
+ // Legend collapses margin, so we're relegated to padding
454
+ legend + .control-group
455
+ margin-top: $baseLineHeight
456
+ -webkit-margin-top-collapse: separate
457
+ // Increase spacing between groups
458
+ .control-group
459
+ margin-bottom: $baseLineHeight
460
+ +clearfix
461
+ // Float the labels left
462
+ .control-group > label
463
+ float: left
464
+ width: 140px
465
+ padding-top: 5px
466
+ text-align: right
467
+ // Move over all input controls and content
468
+ .controls
469
+ margin-left: 160px
470
+ // Move over buttons in .form-actions to align with .controls
471
+ .form-actions
472
+ padding-left: 160px