zurb-foundation 3.2.5 → 4.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (239) hide show
  1. data/.gitignore +6 -2
  2. data/CHANGELOG.md +1 -26
  3. data/CONTRIBUTING.md +18 -0
  4. data/Gemfile.lock +19 -0
  5. data/Gruntfile.js +27 -0
  6. data/README.md +5 -6
  7. data/{Capfile → docs/Capfile} +0 -1
  8. data/docs/Gemfile +8 -0
  9. data/docs/Gemfile.lock +43 -0
  10. data/docs/Procfile +2 -0
  11. data/docs/README.md +1 -0
  12. data/docs/_sidebar-components.html.erb +109 -0
  13. data/docs/_sidebar.html.erb +109 -0
  14. data/docs/_zurb-jobs.html.erb +5 -0
  15. data/docs/changelog.html.erb +185 -0
  16. data/docs/compile.rb +43 -0
  17. data/docs/components/alert-boxes.html.erb +202 -0
  18. data/docs/components/block-grid.html.erb +118 -0
  19. data/docs/components/breadcrumbs.html.erb +146 -0
  20. data/docs/components/button-groups.html.erb +174 -0
  21. data/docs/components/buttons.html.erb +220 -0
  22. data/docs/components/clearing.html.erb +152 -0
  23. data/docs/components/custom-forms.html.erb +306 -0
  24. data/docs/components/dropdown-buttons.html.erb +233 -0
  25. data/docs/components/dropdown.html.erb +186 -0
  26. data/docs/components/flex-video.html.erb +93 -0
  27. data/docs/components/forms.html.erb +468 -0
  28. data/docs/components/grid.html.erb +355 -0
  29. data/docs/components/inline-lists.html.erb +89 -0
  30. data/docs/components/joyride.html.erb +178 -0
  31. data/docs/components/keystrokes.html.erb +74 -0
  32. data/docs/components/labels.html.erb +98 -0
  33. data/docs/components/magellan.html.erb +84 -0
  34. data/docs/components/orbit.html.erb +262 -0
  35. data/docs/components/pagination.html.erb +181 -0
  36. data/docs/components/panels.html.erb +121 -0
  37. data/docs/components/pricing-tables.html.erb +154 -0
  38. data/docs/components/progress-bars.html.erb +120 -0
  39. data/docs/components/reveal.html.erb +147 -0
  40. data/docs/components/section.html.erb +156 -0
  41. data/docs/components/side-nav.html.erb +122 -0
  42. data/docs/components/split-buttons.html.erb +218 -0
  43. data/docs/components/sub-nav.html.erb +120 -0
  44. data/docs/components/switch.html.erb +288 -0
  45. data/docs/components/tables.html.erb +123 -0
  46. data/docs/components/thumbnails.html.erb +87 -0
  47. data/docs/components/tooltips.html.erb +73 -0
  48. data/docs/components/top-bar.html.erb +219 -0
  49. data/docs/components/type.html.erb +359 -0
  50. data/docs/components/visibility.html.erb +102 -0
  51. data/docs/config.ru +12 -0
  52. data/docs/config/deploy.rb +33 -0
  53. data/docs/controller.rb +43 -0
  54. data/docs/css/_coderay.scss +116 -0
  55. data/docs/css/_settings.scss +1 -0
  56. data/docs/css/docs.scss +174 -0
  57. data/docs/css/normalize.scss +396 -0
  58. data/docs/css/qunit-composite.css +13 -0
  59. data/docs/css/qunit.css +235 -0
  60. data/docs/faq.html.erb +61 -0
  61. data/docs/img/demos/demo1-th.png +0 -0
  62. data/docs/img/demos/demo1.png +0 -0
  63. data/docs/img/demos/demo2-th.png +0 -0
  64. data/docs/img/demos/demo2.png +0 -0
  65. data/docs/img/demos/demo3-th.png +0 -0
  66. data/docs/img/demos/demo3.png +0 -0
  67. data/docs/img/demos/demo4-th.png +0 -0
  68. data/docs/img/demos/demo4.png +0 -0
  69. data/docs/img/demos/demo5-th.png +0 -0
  70. data/docs/img/demos/demo5.png +0 -0
  71. data/docs/index.html.erb +299 -0
  72. data/docs/javascript.html.erb +133 -0
  73. data/docs/js/docs.js +3 -0
  74. data/docs/js/qunit-composite.js +105 -0
  75. data/docs/js/qunit.js +1977 -0
  76. data/docs/js/tests/tabs/simple_tabs.html +57 -0
  77. data/docs/js/tests/tabs/simple_tabs.js +54 -0
  78. data/docs/js/tests/tooltips/tooltips.html +39 -0
  79. data/docs/js/tests/tooltips/tooltips.js +11 -0
  80. data/docs/layout.html.erb +99 -0
  81. data/docs/rails.html.erb +66 -0
  82. data/docs/sass.html.erb +299 -0
  83. data/docs/support.html.erb +134 -0
  84. data/foundation.gemspec +2 -4
  85. data/index.html +3 -23
  86. data/js/foundation/foundation.alerts.js +50 -0
  87. data/js/foundation/foundation.clearing.js +478 -0
  88. data/{vendor/assets/javascripts/foundation/jquery.cookie.js → js/foundation/foundation.cookie.js} +3 -1
  89. data/js/foundation/foundation.dropdown.js +122 -0
  90. data/js/foundation/foundation.forms.js +403 -0
  91. data/js/foundation/foundation.joyride.js +613 -0
  92. data/js/foundation/foundation.js +331 -0
  93. data/js/foundation/foundation.magellan.js +130 -0
  94. data/js/foundation/foundation.orbit.js +355 -0
  95. data/{vendor/assets/javascripts/foundation/jquery.placeholder.js → js/foundation/foundation.placeholder.js} +4 -2
  96. data/js/foundation/foundation.reveal.js +264 -0
  97. data/js/foundation/foundation.section.js +180 -0
  98. data/js/foundation/foundation.tooltips.js +195 -0
  99. data/js/foundation/foundation.topbar.js +187 -0
  100. data/js/foundation/index.js +16 -0
  101. data/{vendor/assets/javascripts/foundation/modernizr.foundation.js → js/vendor/custom.modernizr.js} +0 -0
  102. data/js/vendor/jquery.js +9597 -0
  103. data/js/vendor/zepto.js +1782 -0
  104. data/lib/foundation/engine.rb +8 -1
  105. data/lib/foundation/generators/install_generator.rb +24 -1
  106. data/lib/foundation/generators/templates/application.html.erb +20 -6
  107. data/lib/foundation/generators/templates/application.html.haml +2 -6
  108. data/lib/foundation/generators/templates/application.html.slim +2 -5
  109. data/lib/foundation/version.rb +1 -1
  110. data/lib/zurb-foundation.rb +7 -9
  111. data/package.json +9 -0
  112. data/scss/foundation.scss +42 -15
  113. data/scss/foundation/_foundation-global.scss +226 -0
  114. data/scss/foundation/components/_alert-boxes.scss +106 -0
  115. data/scss/foundation/components/_block-grid.scss +63 -0
  116. data/scss/foundation/components/_breadcrumbs.scss +117 -0
  117. data/scss/foundation/components/_button-groups.scss +59 -0
  118. data/scss/foundation/components/_buttons.scss +217 -0
  119. data/scss/foundation/components/_clearing.scss +209 -0
  120. data/scss/foundation/components/_custom-forms.scss +232 -0
  121. data/scss/foundation/components/_dropdown-buttons.scss +114 -0
  122. data/scss/foundation/components/_dropdown.scss +137 -0
  123. data/scss/foundation/components/_flex-video.scss +45 -0
  124. data/scss/foundation/components/_forms.scss +309 -0
  125. data/scss/foundation/components/_grid.scss +149 -71
  126. data/scss/foundation/components/_inline-lists.scss +47 -0
  127. data/scss/foundation/components/_joyride.scss +193 -0
  128. data/scss/foundation/components/_keystrokes.scss +56 -0
  129. data/scss/foundation/components/_labels.scss +81 -0
  130. data/scss/foundation/components/_magellan.scss +15 -0
  131. data/scss/foundation/components/_orbit.scss +193 -0
  132. data/scss/foundation/components/_pagination.scss +99 -0
  133. data/scss/foundation/components/_panels.scss +76 -0
  134. data/scss/foundation/components/_pricing-tables.scss +130 -0
  135. data/scss/foundation/components/_progress-bars.scss +68 -0
  136. data/scss/foundation/components/_reveal.scss +131 -0
  137. data/scss/foundation/components/_section.scss +194 -0
  138. data/scss/foundation/components/_side-nav.scss +68 -0
  139. data/scss/foundation/components/_split-buttons.scss +159 -0
  140. data/scss/foundation/components/_sub-nav.scss +67 -0
  141. data/scss/foundation/components/_switch.scss +242 -0
  142. data/scss/foundation/components/_tables.scss +80 -0
  143. data/scss/foundation/components/_thumbs.scss +45 -0
  144. data/scss/foundation/components/_tooltips.scss +113 -0
  145. data/scss/foundation/components/_top-bar.scss +443 -0
  146. data/scss/foundation/components/_type.scss +411 -0
  147. data/scss/foundation/components/_visibility.scss +117 -0
  148. data/scss/normalize.scss +396 -0
  149. data/templates/project/config.rb +26 -0
  150. data/templates/project/index.html +28 -43
  151. data/templates/project/manifest.rb +21 -28
  152. data/templates/project/scss/_settings.scss +4 -243
  153. data/templates/project/scss/app.scss +37 -44
  154. data/templates/project/scss/normalize.scss +396 -0
  155. data/test/stylesheets/styles.css +955 -0
  156. metadata +144 -153
  157. data/config/deploy.rb +0 -42
  158. data/lib/foundation/generators/layout_generator.rb +0 -28
  159. data/scss/foundation/_settings.scss +0 -281
  160. data/scss/foundation/common/_base.scss +0 -4
  161. data/scss/foundation/common/_forms.scss +0 -117
  162. data/scss/foundation/common/_globals.scss +0 -35
  163. data/scss/foundation/common/_ratios.scss +0 -19
  164. data/scss/foundation/common/_typography.scss +0 -104
  165. data/scss/foundation/components/modules/_all.scss +0 -10
  166. data/scss/foundation/components/modules/_buttons.scss +0 -178
  167. data/scss/foundation/components/modules/_clearing.scss +0 -61
  168. data/scss/foundation/components/modules/_joyride.scss +0 -33
  169. data/scss/foundation/components/modules/_mqueries.scss +0 -458
  170. data/scss/foundation/components/modules/_navbar.scss +0 -74
  171. data/scss/foundation/components/modules/_offcanvas.scss +0 -55
  172. data/scss/foundation/components/modules/_orbit.scss +0 -90
  173. data/scss/foundation/components/modules/_reveal.scss +0 -34
  174. data/scss/foundation/components/modules/_tabs.scss +0 -67
  175. data/scss/foundation/components/modules/_topbar.scss +0 -167
  176. data/scss/foundation/components/modules/_ui.scss +0 -292
  177. data/scss/foundation/functions/_all.scss +0 -2
  178. data/scss/foundation/functions/_convert-number-to-word.scss +0 -10
  179. data/scss/foundation/functions/_grid-calc.scss +0 -5
  180. data/scss/foundation/functions/modular-scale.scss +0 -3
  181. data/scss/foundation/mixins/_all.scss +0 -5
  182. data/scss/foundation/mixins/_clearfix.scss +0 -13
  183. data/scss/foundation/mixins/_css-triangle.scss +0 -22
  184. data/scss/foundation/mixins/_font-size.scss +0 -13
  185. data/scss/foundation/mixins/_respond-to.scss +0 -11
  186. data/scss/foundation/mixins/_semantic-grid.scss +0 -66
  187. data/test/buttons.html +0 -189
  188. data/test/clearing.html +0 -85
  189. data/test/config.rb +0 -11
  190. data/test/elements.html +0 -490
  191. data/test/forms.html +0 -371
  192. data/test/grid.html +0 -543
  193. data/test/images/orbit-demo/demo1.jpeg +0 -0
  194. data/test/images/orbit-demo/demo2.jpeg +0 -0
  195. data/test/images/orbit-demo/demo3.jpeg +0 -0
  196. data/test/images/orbit-demo/slider-background.jpeg +0 -0
  197. data/test/index.html +0 -83
  198. data/test/joyride.html +0 -127
  199. data/test/magellan.html +0 -112
  200. data/test/navigation.html +0 -269
  201. data/test/orbit.html +0 -112
  202. data/test/reveal.html +0 -91
  203. data/test/scss/_settings.scss +0 -245
  204. data/test/scss/styles.scss +0 -50
  205. data/test/tabs.html +0 -197
  206. data/test/template.html +0 -52
  207. data/test/topbar-login.html +0 -194
  208. data/test/topbar.html +0 -139
  209. data/test/type.html +0 -188
  210. data/vendor/assets/images/foundation/orbit/bullets.jpg +0 -0
  211. data/vendor/assets/images/foundation/orbit/left-arrow-small.png +0 -0
  212. data/vendor/assets/images/foundation/orbit/left-arrow.png +0 -0
  213. data/vendor/assets/images/foundation/orbit/loading.gif +0 -0
  214. data/vendor/assets/images/foundation/orbit/mask-black.png +0 -0
  215. data/vendor/assets/images/foundation/orbit/pause-black.png +0 -0
  216. data/vendor/assets/images/foundation/orbit/right-arrow-small.png +0 -0
  217. data/vendor/assets/images/foundation/orbit/right-arrow.png +0 -0
  218. data/vendor/assets/images/foundation/orbit/rotator-black.png +0 -0
  219. data/vendor/assets/images/foundation/orbit/timer-black.png +0 -0
  220. data/vendor/assets/javascripts/foundation/app.js +0 -41
  221. data/vendor/assets/javascripts/foundation/index.js +0 -19
  222. data/vendor/assets/javascripts/foundation/jquery.event.move.js +0 -580
  223. data/vendor/assets/javascripts/foundation/jquery.event.swipe.js +0 -130
  224. data/vendor/assets/javascripts/foundation/jquery.foundation.accordion.js +0 -47
  225. data/vendor/assets/javascripts/foundation/jquery.foundation.alerts.js +0 -20
  226. data/vendor/assets/javascripts/foundation/jquery.foundation.buttons.js +0 -83
  227. data/vendor/assets/javascripts/foundation/jquery.foundation.clearing.js +0 -413
  228. data/vendor/assets/javascripts/foundation/jquery.foundation.forms.js +0 -502
  229. data/vendor/assets/javascripts/foundation/jquery.foundation.joyride.js +0 -639
  230. data/vendor/assets/javascripts/foundation/jquery.foundation.magellan.js +0 -96
  231. data/vendor/assets/javascripts/foundation/jquery.foundation.mediaQueryToggle.js +0 -27
  232. data/vendor/assets/javascripts/foundation/jquery.foundation.navigation.js +0 -55
  233. data/vendor/assets/javascripts/foundation/jquery.foundation.orbit.js +0 -919
  234. data/vendor/assets/javascripts/foundation/jquery.foundation.reveal.js +0 -794
  235. data/vendor/assets/javascripts/foundation/jquery.foundation.tabs.js +0 -66
  236. data/vendor/assets/javascripts/foundation/jquery.foundation.tooltips.js +0 -211
  237. data/vendor/assets/javascripts/foundation/jquery.foundation.topbar.js +0 -174
  238. data/vendor/assets/javascripts/foundation/jquery.js +0 -9555
  239. data/vendor/assets/javascripts/foundation/jquery.offcanvas.js +0 -50
@@ -0,0 +1,468 @@
1
+ <div class="row">
2
+ <div class="large-9 push-3 columns">
3
+
4
+ <% @page_title = "Forms" %>
5
+ <div class="row">
6
+ <div class="large-12 columns">
7
+ <h2><%= @page_title %></h2>
8
+ <h4 class="subheader">With Foundation, we set out to create an easy to handle, powerful and versatile form layout system. A combination of form styles and the Foundation grid means you can do basically anything.</h4>
9
+
10
+ <form>
11
+ <fieldset>
12
+ <legend>Fieldset</legend>
13
+
14
+ <div class="row">
15
+ <div class="large-12 columns">
16
+ <label>Input Label</label>
17
+ <input type="text" placeholder="large-12.columns">
18
+ </div>
19
+ </div>
20
+
21
+ <div class="row">
22
+ <div class="large-4 columns">
23
+ <label>Input Label</label>
24
+ <input type="text" placeholder="large-4.columns">
25
+ </div>
26
+ <div class="large-4 columns">
27
+ <label>Input Label</label>
28
+ <input type="text" placeholder="large-4.columns">
29
+ </div>
30
+ <div class="large-4 columns">
31
+ <div class="row collapse">
32
+ <label>Input Label</label>
33
+ <div class="small-9 columns">
34
+ <input type="text" placeholder="small-9.columns">
35
+ </div>
36
+ <div class="small-3 columns">
37
+ <span class="postfix">.com</span>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </div>
42
+
43
+ <div class="row">
44
+ <div class="large-12 columns">
45
+ <label>Textarea Label</label>
46
+ <textarea placeholder="small-12.columns"></textarea>
47
+ </div>
48
+ </div>
49
+
50
+ </fieldset>
51
+ </form>
52
+
53
+ <hr>
54
+ </div>
55
+ </div>
56
+
57
+ <div class="row">
58
+ <div class="large-12 columns">
59
+
60
+ <h3>Building Forms with HTML</h3>
61
+ <p>OK, so you have a client that needs a form with an unhuman layout. "You can't back down because of some legal reason," he says. What are you to do? Foundation has you covered with versatile forms that looks great out of the box and are easily customizable as you need.</p>
62
+
63
+ <p>Form elements in Foundation are styled based on their type attribute rather than a class. Inputs in Foundation have another major advantage &mdash; they are full width by default. That means that inputs will run as wide as the column that contains them. However, you have two options which make these forms extremely versatile:</p>
64
+
65
+ <ul class="disc">
66
+ <li>You can size inputs using column sizes, like <code>.large-6</code>, <code>.small-6</code>.</li>
67
+ <li>You can create row elements inside your form and use columns for the form, including inputs, labels and more. Rows inside a form inherit some special padding to even up input spacing.</li>
68
+ </ul>
69
+
70
+ <p>This ultimately adds a bit of code to your forms, but it's worth the trade off! Here's what the example above looks like in HTML:</p>
71
+
72
+ <%= code_example '
73
+ <form>
74
+ <fieldset>
75
+ <legend>Fieldset</legend>
76
+
77
+ <div class="row">
78
+ <div class="large-12 columns">
79
+ <label>Input Label</label>
80
+ <input type="text" placeholder="large-12.columns">
81
+ </div>
82
+ </div>
83
+
84
+ <div class="row">
85
+ <div class="large-4 columns">
86
+ <label>Input Label</label>
87
+ <input type="text" placeholder="large-4.columns">
88
+ </div>
89
+ <div class="large-4 columns">
90
+ <label>Input Label</label>
91
+ <input type="text" placeholder="large-4.columns">
92
+ </div>
93
+ <div class="large-4 columns">
94
+ <div class="row collapse">
95
+ <label>Input Label</label>
96
+ <div class="small-9 columns">
97
+ <input type="text" placeholder="small-9.columns">
98
+ </div>
99
+ <div class="small-3 columns">
100
+ <span class="postfix">.com</span>
101
+ </div>
102
+ </div>
103
+ </div>
104
+ </div>
105
+
106
+ <div class="row">
107
+ <div class="large-12 columns">
108
+ <label>Textarea Label</label>
109
+ <textarea placeholder="small-12.columns"></textarea>
110
+ </div>
111
+ </div>
112
+
113
+ </fieldset>
114
+ </form>', :html %>
115
+
116
+ <hr>
117
+
118
+ <h4>Inline Labels</h4>
119
+ <p>Sometimes you want a form with labels to the left of your inputs. Piece of cake. You can put the label inside a different column to the left of the input. Then add a class of <code>.right</code> to the label to have it align to the right.</p>
120
+
121
+ <%= code_example '
122
+ <form>
123
+ <div class="row">
124
+ <div class="small-8">
125
+ <div class="row">
126
+ <div class="small-3 columns">
127
+ <label for="right-label" class="right">Label</label>
128
+ </div>
129
+ <div class="small-9 columns">
130
+ <input type="text" id="right-label" placeholder="Inline Text Input">
131
+ </div>
132
+ </div>
133
+ </div>
134
+ </div>
135
+ </form>
136
+ ', :html %>
137
+
138
+ <form>
139
+ <div class="row">
140
+ <div class="small-8">
141
+ <div class="row">
142
+ <div class="small-3 columns">
143
+ <label for="right-label" class="right">Label</label>
144
+ </div>
145
+ <div class="small-9 columns">
146
+ <input type="text" id="right-label" placeholder="Inline Text Input">
147
+ </div>
148
+ </div>
149
+ </div>
150
+ </div>
151
+ </form>
152
+
153
+ <p>Adding a class of <code>.inline</code> will have it vertically center against an input. You can use one or both of these classes to accomplish the look you want.</p>
154
+
155
+ <%= code_example '
156
+ <form>
157
+ <div class="row">
158
+ <div class="small-8">
159
+ <div class="row">
160
+ <div class="small-3 columns">
161
+ <label for="right-label" class="right inline">Label</label>
162
+ </div>
163
+ <div class="small-9 columns">
164
+ <input type="text" id="right-label" placeholder="Inline Text Input">
165
+ </div>
166
+ </div>
167
+ </div>
168
+ </div>
169
+ </form>
170
+ ', :html %>
171
+
172
+ <form>
173
+ <div class="row">
174
+ <div class="small-8">
175
+ <div class="row">
176
+ <div class="small-3 columns">
177
+ <label for="right-label" class="right inline">Label</label>
178
+ </div>
179
+ <div class="small-9 columns">
180
+ <input type="text" id="right-label" placeholder="Inline Text Input">
181
+ </div>
182
+ </div>
183
+ </div>
184
+ </div>
185
+ </form>
186
+
187
+ <hr>
188
+
189
+ <h4>Defining a Fieldset</h4>
190
+ <p>We don't see them too much, but one of the useful form elements included with Foundation is <code>&lt;fieldset&gt;</code>. This is used as a wrapper right inside the form element. Right after you define a fieldset, you can include a legend title by using <code>&lt;legend&gt;</code>. Here's some HTML to help make copy paste.</p>
191
+
192
+ <%= code_example '
193
+ <form>
194
+ <fieldset>
195
+ <legend>Fieldset Legend</legend>
196
+
197
+ <label>Input Label</label>
198
+ <input type="text" placeholder="Inputs and other form elements go inside...">
199
+ </fieldset>
200
+ </form>', :html %>
201
+
202
+ <form>
203
+ <fieldset>
204
+ <legend>Fieldset Legend</legend>
205
+
206
+ <label>Input Label</label>
207
+ <input type="text" placeholder="Inputs and other form elements go inside...">
208
+ </fieldset>
209
+ </form>
210
+
211
+ <hr>
212
+
213
+ <h4>Pre/Postfix Labels &amp; Actions</h4>
214
+ <p>Foundation forms support actions tied to buttons, and prefix / postfix labels, through a versatile approach using special grid properties. Essentially you can use <code>&lt;row class="collapse"&gt;</code> to create label / action / input combinations. You use the Foundation columns to define the size of the pre/postfix <code>&lt;span class="postfix"&gt;</code> or <code>&lt;span class="prefix"&gt;</code>. Here are a few examples:</p>
215
+
216
+ <%= code_example '
217
+ <form>
218
+ <div class="row collapse">
219
+ <div class="small-3 large-2 columns">
220
+ <span class="prefix">http://</span>
221
+ </div>
222
+ <div class="small-9 large-10 columns">
223
+ <input type="text" placeholder="Enter your URL...">
224
+ </div>
225
+ </div>
226
+ <div class="row">
227
+ <div class="large-6 columns">
228
+ <div class="row collapse">
229
+ <div class="small-10 columns">
230
+ <input type="text" placeholder="Hex Value">
231
+ </div>
232
+ <div class="small-2 columns">
233
+ <a href="#" class="button prefix">Action</a>
234
+ </div>
235
+ </div>
236
+ </div>
237
+ <div class="large-6 columns">
238
+ <div class="row collapse">
239
+ <div class="small-9 columns">
240
+ <input type="text" placeholder="Value">
241
+ </div>
242
+ <div class="small-3 columns">
243
+ <span class="postfix radius">Label</span>
244
+ </div>
245
+ </div>
246
+ </div>
247
+ </div>
248
+ </form>', :html %>
249
+
250
+ <form>
251
+ <div class="row collapse">
252
+ <div class="small-3 large-2 columns">
253
+ <span class="prefix">http://</span>
254
+ </div>
255
+ <div class="small-9 large-10 columns">
256
+ <input type="text" placeholder="Enter your URL...">
257
+ </div>
258
+ </div>
259
+ <div class="row">
260
+ <div class="large-6 columns">
261
+ <div class="row collapse">
262
+ <div class="small-10 columns">
263
+ <input type="text" placeholder="Hex Value">
264
+ </div>
265
+ <div class="small-2 columns">
266
+ <a href="#" class="button prefix">Action</a>
267
+ </div>
268
+ </div>
269
+ </div>
270
+ <div class="large-6 columns">
271
+ <div class="row collapse">
272
+ <div class="small-9 columns">
273
+ <input type="text" placeholder="Value">
274
+ </div>
275
+ <div class="small-3 columns">
276
+ <span class="postfix radius">Label</span>
277
+ </div>
278
+ </div>
279
+ </div>
280
+ </div>
281
+ </form>
282
+
283
+ <p>You'll notice that on the last postfix element, we've included the class of <code>radius</code>. This adds the border radius on the appropriate edge depending on whether it's a prefix or a postfix element. You can even include buttons with these styles, just apply the <code>.button</code> as well as the pre/postfix class.</p>
284
+
285
+ <hr>
286
+
287
+ <h4>Error States</h4>
288
+ <p>Foundation includes error states for labels, inputs and messaging that you can have your app generate programatically. You can attach a class of <code>.error</code> either to the individual elements (label, input, small) or to a column/div.</p>
289
+
290
+ <%= code_example '
291
+ <form>
292
+ <div class="row">
293
+ <div class="large-6 columns">
294
+ <label class="error">Error</label>
295
+ <input type="text" class="error" />
296
+ <small class="error">Invalid entry</small>
297
+ </div>
298
+ <div class="large-6 columns error">
299
+ <label>Another Error</label>
300
+ <input type="text" />
301
+ <small>Invalid entry</small>
302
+ </div>
303
+ </div>
304
+ <textarea class="error" placeholder="Message..."></textarea>
305
+ <small class="error">Invalid entry</small>
306
+ </form>', :html %>
307
+
308
+ <form>
309
+ <div class="row">
310
+ <div class="large-6 columns">
311
+ <label class="error">Error</label>
312
+ <input type="text" class="error" />
313
+ <small class="error">Invalid entry</small>
314
+ </div>
315
+
316
+ <div class="large-6 columns error">
317
+ <label>Another Error</label>
318
+ <input type="text" />
319
+ <small>Invalid entry</small>
320
+ </div>
321
+ </div>
322
+
323
+ <textarea class="error" placeholder="Message..."></textarea>
324
+ <small class="error">Invalid entry</small>
325
+ </form>
326
+
327
+ <hr>
328
+
329
+ <h3>Build with Mixins</h3>
330
+ <p>A lot of elements in Foundation can be created using SCSS mixins so that you can include your own classes and just enough style as needed for the job at hand. To use these mixins, you'll need to have the extension installed or grab <a href="#">_foundation-global.scss</a> and <a href="#">_forms.scss</a> from Github and throw them into a Foundation folder in your project directory. From there, you can import the files at the top of your own SCSS stylesheet, like so:</p>
331
+
332
+ <%= code_example '
333
+ @import "foundation/foundation-global", "foundation/forms";', :css %>
334
+
335
+ <p>We include most of the form styles by default, but the ones that are attached to HTML classes can be accessed via the mixins below. The error states have mixins, but we suggest using the classes since they are usually only visible temporarily.</p>
336
+
337
+ <h5>The Pre/Postfix Mixin</h5>
338
+ <p>With the form label mixin, you can control which classes make your labels line up how you want them to next to their form elements. You'll use these in conjunction with the grid mixin.</p>
339
+
340
+ <%= code_example '
341
+ <form>
342
+ <div class="row collapse">
343
+ <span class="your-prefix-class">Label</span>
344
+ <input type="text" class="your-label-class" placeholder="Value">
345
+ </div>
346
+ </form>', :html %>
347
+
348
+ <p>Since you need to wrap columns in a container anyway, we've used a <code>.row.collapse</code> rather than creating our own class to hold those mixins. Feel free to attach those styles to your own class or ID though.</p>
349
+
350
+ <h6>The base mixin:</h6>
351
+
352
+ <%= code_example '
353
+ .your-prefix-class {
354
+ @include prefix-postfix-base;
355
+ @include grid-column($columns:3,$float:left);
356
+ }
357
+
358
+ input[type="text"].your-input-class {
359
+ @include grid-column($columns:9);
360
+ }', :css %>
361
+
362
+ <form>
363
+ <div class="row collapse">
364
+ <span class="attached-label">Label</span>
365
+ <input type="text" class="attached-input" placeholder="Value">
366
+ </div>
367
+ </form>
368
+
369
+ <h6>The Prefix &amp; Postfix Style Mixins</h6>
370
+ <p>You can control the style you add to your prefix or postfix elements using this mixin, it looks like this:</p>
371
+
372
+ <%= code_example '
373
+ .your-prefix-class {
374
+ @include prefix-postfix-base;
375
+ @include prefix;
376
+ @include grid-column($columns:3,$float:left);
377
+ }
378
+
379
+ input[type="text"].your-input-class {
380
+ @include grid-column($columns:9);
381
+ }', :css %>
382
+
383
+ <form>
384
+ <div class="row collapse">
385
+ <span class="attached-label style">Label</span>
386
+ <input type="text" class="attached-input" placeholder="Value">
387
+ </div>
388
+ </form>
389
+
390
+ <p>There are two options you can set with the prefix and postfix mixins, these are:</p>
391
+
392
+ <%= code_example '
393
+ @include prefix($bg, $is-button);
394
+
395
+ /* Control the background color, which also effect the border and font color */
396
+ $bg: $input-prefix-bg
397
+
398
+ /* If you prefix or postfix element is a button, make sure to set this to true */
399
+ $is-button: false
400
+ ', :css %>
401
+
402
+ <form>
403
+ <div class="row collapse">
404
+ <span class="attached-label style custom">Label</span>
405
+ <input type="text" class="attached-input" placeholder="Value">
406
+ </div>
407
+ </form>
408
+
409
+ <h5>Default SCSS Variables</h5>
410
+ <%= code_example '
411
+ /* We use this to set the base for lots of form spacing and positioning styles */
412
+ $form-spacing: emCalc(16px);
413
+
414
+ /* We use these to style the labels in different ways */
415
+ $label-pointer: pointer;
416
+ $label-font-size: emCalc(14px);
417
+ $label-font-weight: 500;
418
+ $label-font-color: lighten(#000, 30%);
419
+ $label-bottom-margin: emCalc(3px);
420
+ $input-font-color: rgba(0,0,0,0.75);
421
+ $input-font-size: emCalc(14px);
422
+ $input-bg-color: #fff;
423
+ $input-focus-bg-color: darken(#fff, 2%);
424
+ $input-border-color: darken(#fff, 20%);
425
+ $input-focus-border-color: darken(#fff, 40%);
426
+ $input-border-style: solid;
427
+ $input-border-width: 1px;
428
+ $input-disabled-bg: #ddd;
429
+ $input-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
430
+
431
+ /* We use these to style the fieldset border and spacing. */
432
+ $fieldset-border-style: solid;
433
+ $fieldset-border-width: 1px;
434
+ $fieldset-border-color: #ddd;
435
+ $fieldset-padding: emCalc(20px);
436
+ $fieldset-margin: emCalc(18px) 0;
437
+
438
+ /* We use these to style the legends when you use them */
439
+ $legend-bg: #fff;
440
+ $legend-font-weight: bold;
441
+ $legend-padding: 0 emCalc(3px);
442
+
443
+ /* We use these to style the prefix and postfix input elements */
444
+ $input-prefix-bg: darken(#fff, 5%);
445
+ $input-prefix-border-color: darken(#fff, 20%);
446
+ $input-prefix-border-size: 1px;
447
+ $input-prefix-border-type: solid;
448
+ $input-prefix-overflow: hidden;
449
+ $input-prefix-font-color: #333;
450
+ $input-prefix-font-color-alt: #fff;
451
+
452
+ /* We use these to style the error states for inputs and labels */
453
+ $input-error-message-padding: emCalc(6px) emCalc(4px);
454
+ $input-error-message-top: -($form-spacing) - emCalc(5px);
455
+ $input-error-message-font-size: emCalc(12px);
456
+ $input-error-message-font-weight: bold;
457
+ $input-error-message-font-color: #fff;
458
+ $input-error-message-font-color-alt: #333;
459
+ ', :css %>
460
+
461
+ <p><strong>Note:</strong> <code>emCalc();</code> is a function we wrote to convert <code>px</code> to <code>em</code>. It is included in <strong>_foundation-global.scss</strong>.</p>
462
+ </div>
463
+ </div>
464
+ </div>
465
+ <div class="large-3 pull-9 columns">
466
+ <%= render "_sidebar-components.html.erb" %>
467
+ </div>
468
+ </div>