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,218 @@
1
+ <div class="row">
2
+ <div class="large-9 push-3 columns">
3
+
4
+ <% @page_title = "Split Buttons" %>
5
+ <div class="row">
6
+ <div class="large-12 columns">
7
+ <h2><%= @page_title %></h2>
8
+ <h4 class="subheader">We've simplified our split buttons by getting rid of the dedicated dropdown associated with them. Instead, you'll use our <a href="#">new dropdown plugin</a> to attach a dropdown to the button style of your choice.</h4>
9
+ </div>
10
+ </div>
11
+
12
+ <div class="row">
13
+ <div class="large-12 columns">
14
+
15
+ <a href="#" class="tiny button split">Split Button <span data-dropdown="drop"></span></a><br>
16
+ <a href="#" class="small secondary radius button split">Split Button <span data-dropdown="drop2"></span></a><br>
17
+ <a href="#" class="button alert round split">Split Button <span data-dropdown="drop3"></span></a><br>
18
+ <a href="#" class="large success button split">Split Button <span data-dropdown="drop4"></span></a><br>
19
+
20
+ <hr>
21
+
22
+ <h3>Build With Predefined HTML Classes</h3>
23
+ <p>There are two ways to build buttons in Foundation 4: with our predefined HTML classes or our structure and mixins. Building buttons using our predefined classes is simple, you'll need an <code>&lt;a&gt;</code>, <code>&lt;button&gt;</code> or <code>&lt;input&gt;</code> with a class of <code>.button.split</code>. This will create a default medium button. You can also use size, color and radius classes to control more of the style.</p>
24
+
25
+ <p>The classes options:</p>
26
+ <ul class="disc">
27
+ <li>The size classes include: <code>.tiny, .small, .medium</code> or <code>.large</code></li>
28
+ <li>The color classes include: <code>.secondary, .alert</code> or <code>.success</code></li>
29
+ <li>The radius classes include: <code>.radius</code> or <code>.round</code>.</li>
30
+ </ul>
31
+
32
+ <%= code_example '
33
+ <!-- Size Classes -->
34
+ <a href="#" class="button split">Default Button</a>
35
+ <a href="#" class="tiny button split">Tiny Button</a>
36
+ <a href="#" class="small button split">Small Button</a>
37
+ <a href="#" class="large button split">Large Button</a>
38
+
39
+ <!-- Color Classes -->
40
+ <a href="#" class="button split secondary">Secondary Button</a>
41
+ <a href="#" class="button split success">Success Button</a>
42
+ <a href="#" class="button split alert">Alert Button</a>
43
+
44
+ <!-- Radius Classes -->
45
+ <a href="#" class="button split radius">Radius Button</a>
46
+ <a href="#" class="button split round">Round Button</a>
47
+ ', :html %>
48
+
49
+ <p>You may chain one class from each group to build up desired default styles. For these styles to take effect, make sure you have the <strong>default Foundation CSS package</strong> or that you've selected <strong>split buttons from a custom package</strong>. These should be linked up following our default <a href="#getting-started">HTML page structure</a>.</p>
50
+
51
+ <hr>
52
+
53
+ <h3>Build with Mixins</h3>
54
+ <p>We've included SCSS mixins used to style buttons. To use these mixins, you'll need to have the <a href="#extention-install">extension installed</a> or grab <a href="#">_foundation-global.scss</a>, <a href="#">_buttons.scss</a> and <a href="#">_split-buttons.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>
55
+
56
+ <%= code_example '
57
+ @import "foundation/foundation-global", "foundation/buttons", "foundation/split-buttons";
58
+ ', :css %>
59
+
60
+ <p>If you are using the mixins, you may include the styles on whatever class or ID you'd like, just make sure you follow our markup structure:</p>
61
+
62
+ <%= code_example '
63
+ <a href="#" class="your-class-name">Split Button Text</a>
64
+ ', :html %>
65
+
66
+ <h5>Quick Mixin</h5>
67
+ <p>You can quickly build an entire split buttons using our global mixin by including it on your custom class or ID in your stylesheet. The global mixin will create the necessary style for the button. The global mixin looks like this:</p>
68
+
69
+ <%= code_example '
70
+ /* Using the default styles */
71
+ .your-class-name {
72
+ @include button;
73
+ @include split-button;
74
+ }
75
+ ', :css %>
76
+
77
+ <a href="" class="split button">Default Split Button<span data-dropdown="drop5"></span></a>
78
+
79
+ <p>There are also <strong>four options</strong> you can customize on the fly when writing this mixin. These control things like: padding size, pip color, border color and base styles. Setting any of these options to <strong>false</strong> will not include the styles.</p>
80
+
81
+ <%= code_example '
82
+ /* Using the available options */
83
+ .your-class-name {
84
+ @include button;
85
+ @include split-button($padding, $pip-color, $span-border, $base-style);
86
+ }
87
+
88
+ /* This controls padding around the dropdown buttons. Use tiny, small, medium, or large */
89
+ $padding: $button-med
90
+
91
+ /* This controls the dropdown pip color. Set to one of our variables or a custom hex value */
92
+ $pip-color: $split-button-pip-color
93
+
94
+ /* This controls the border color of the triangle span area. This can be a variable or color value. */
95
+ $span-border: $primary-color
96
+
97
+ /* This controls whether or not base styles come through. Set to false to negate */
98
+ /* Handy when you want to have many different styles */
99
+ $base-style: true
100
+ ', :css %>
101
+
102
+ <h5>Default SCSS Variables</h5>
103
+ <%= code_example '
104
+ /* We use these to control different shared styles for Split Buttons */
105
+ $split-button-function-factor: 15%;
106
+ $split-button-pip-color: #fff;
107
+ $split-button-pip-color-alt: #333;
108
+ $split-button-active-bg-tint: rgba(0,0,0,0.1);
109
+
110
+ /* We use these to control tiny split buttons */
111
+ $split-button-padding-tny: $button-tny * 9;
112
+ $split-button-span-width-tny: $button-tny * 6.5;
113
+ $split-button-pip-size-tny: $button-tny;
114
+ $split-button-pip-top-tny: $button-tny * 2;
115
+ $split-button-pip-left-tny: emCalc(-5px);
116
+
117
+ /* We use these to control small split buttons */
118
+ $split-button-padding-sml: $button-sml * 7;
119
+ $split-button-span-width-sml: $button-sml * 5;
120
+ $split-button-pip-size-sml: $button-sml;
121
+ $split-button-pip-top-sml: $button-sml * 1.5;
122
+ $split-button-pip-left-sml: emCalc(-9px);
123
+
124
+ /* We use these to control medium split buttons */
125
+ $split-button-padding-med: $button-med * 6.4;
126
+ $split-button-span-width-med: $button-med * 4;
127
+ $split-button-pip-size-med: $button-med - emCalc(3px);
128
+ $split-button-pip-top-med: $button-med * 1.5;
129
+ $split-button-pip-left-med: emCalc(-9px);
130
+
131
+ /* We use these to control large split buttons */
132
+ $split-button-padding-lrg: $button-lrg * 6;
133
+ $split-button-span-width-lrg: $button-lrg * 3.75;
134
+ $split-button-pip-size-lrg: $button-lrg - emCalc(6px);
135
+ $split-button-pip-top-lrg: $button-lrg + emCalc(5px);
136
+ $split-button-pip-left-lrg: emCalc(-9px);
137
+ ', :css %>
138
+
139
+ <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>
140
+
141
+ <hr>
142
+
143
+ <h3>Using the JavaScript</h3>
144
+ <p>You don't need ths JS to create dropdown button styles with Foundation. The only reason you'll need to include <code>foundation.dropdown.js</code> is if you want to add one of our dropdowns to the button. You'll also need to make sure to include <code>zepto.js</code> and <code>foundation.js</code> above the dropdown plugin.</p>
145
+ <p>Above your closing <code>&lt;/body&gt;</code> tag include the following line of code and make sure you have the JS file in your directory:</p>
146
+
147
+ <p><a href="../javascript.html" title="How to install Foundation JavaScript">Read how to install Foundation JavaScript</a></p>
148
+
149
+ <p>Required Foundation Library: <code>foundation.dropdown.js</code></p>
150
+
151
+ <h5>Creating the Dropdown</h5>
152
+ <p>To create a dropdown, you'll need to attach a data-attribute to whatever element you want the dropdown attached to (in this case a button). From there, you'll create a list that holds the links or content and add another data-attribute that associates with the element it belongs to. Here's an example of that markup:</p>
153
+
154
+ <%= code_example '
155
+ <a href="#" data-dropdown="drop1" class="button dropdown">Dropdown Button</a><br>
156
+
157
+ <ul id="drop1" class="f-dropdown">
158
+ <li><a href="#">This is a link</a></li>
159
+ <li><a href="#">This is another</a></li>
160
+ <li><a href="#">Yet another</a></li>
161
+ </ul>
162
+ ', :html %>
163
+
164
+ <a href="#" class="button split">Dropdown Button <span data-dropdown="drop1"></span></a><br>
165
+
166
+ <p>You'll notice that <code>data-dropdown="drop1"</code> and <code>id="drop1"</code> have similar values. This is what tells the dropdown plugin where to look to find the position to attach the dropdown element to.</p>
167
+
168
+ <h5>Optional JavaScript Configuration</h5>
169
+
170
+ <p>Dropdwon button options can only be passed in during initialization at this time.</p>
171
+
172
+ <%= code_example "
173
+ {
174
+ // specify the class used for active sections
175
+ activeClass: 'open'
176
+ }", :json %>
177
+
178
+ </div>
179
+ </div>
180
+
181
+ </div>
182
+ <div class="large-3 pull-9 columns">
183
+ <%= render "_sidebar-components.html.erb" %>
184
+ </div>
185
+ </div>
186
+
187
+ <ul id="drop" class="f-dropdown" data-dropdown-content>
188
+ <li><a href="#">This is a link</a></li>
189
+ <li><a href="#">This is another</a></li>
190
+ <li><a href="#">Yet another</a></li>
191
+ </ul>
192
+ <ul id="drop1" class="f-dropdown" data-dropdown-content>
193
+ <li><a href="#">This is a link</a></li>
194
+ <li><a href="#">This is another</a></li>
195
+ <li><a href="#">Yet another</a></li>
196
+ </ul>
197
+ <ul id="drop2" class="f-dropdown" data-dropdown-content>
198
+ <li><a href="#">This is a link</a></li>
199
+ <li><a href="#">This is another</a></li>
200
+ <li><a href="#">Yet another</a></li>
201
+ </ul>
202
+ <ul id="drop3" class="f-dropdown" data-dropdown-content>
203
+ <li><a href="#">This is a link</a></li>
204
+ <li><a href="#">This is another</a></li>
205
+ <li><a href="#">Yet another</a></li>
206
+ </ul>
207
+ <ul id="drop4" class="f-dropdown" data-dropdown-content>
208
+ <li><a href="#">This is a link</a></li>
209
+ <li><a href="#">This is another</a></li>
210
+ <li><a href="#">Yet another</a></li>
211
+ </ul>
212
+ <ul id="drop5" class="f-dropdown" data-dropdown-content>
213
+ <li><a href="#">This is a link</a></li>
214
+ <li><a href="#">This is another</a></li>
215
+ <li><a href="#">Yet another</a></li>
216
+ </ul>
217
+
218
+
@@ -0,0 +1,120 @@
1
+ <div class="row">
2
+ <div class="large-9 push-3 columns">
3
+
4
+ <% @page_title = "Sub Nav" %>
5
+ <div class="row">
6
+ <div class="large-12 columns">
7
+ <h1><%= @page_title %></h1>
8
+ <h4 class="subheader">This simple sub nav is great for moving between different states of a page. We use these frequently to show iterations of something, typically by date, but they're also handy for filters like these.</h4>
9
+ </div>
10
+ </div>
11
+
12
+ <div class="row">
13
+ <div class="large-12 columns">
14
+
15
+ <dl class="sub-nav">
16
+ <dt>Filter:</dt>
17
+ <dd class="active"><a href="#">All</a></dd>
18
+ <dd><a href="#">Active</a></dd>
19
+ <dd><a href="#">Pending</a></dd>
20
+ <dd><a href="#">Suspended</a></dd>
21
+ </dl>
22
+
23
+ <hr>
24
+
25
+ <h3>Build With Predefined HTML Classes</h3>
26
+ <p>There are two ways to build sub nav in Foundation 4: you can use our predefined HTML classes or our mixins. Building sub nav using our predefined classes is simple, you'll just need to write a <code>&lt;dl class="sub-nav"&gt;</code> and fill it full of definitions. You can use the definition title as a label at the beginning (useful for building filters on a page).</p>
27
+
28
+ <p>The list options:</p>
29
+ <ul class="disc">
30
+ <li><code>&lt;dt&gt;</code> Creates a title at the beginning of the list.</li>
31
+ <li><code>&lt;dd class="active"&gt;</code> Will add style to denote the active link.</li>
32
+ </ul>
33
+
34
+ <%= code_example '
35
+ <dl class="sub-nav">
36
+ <dt>Filter:</dt>
37
+ <dd class="active"><a href="#">All</a></dd>
38
+ <dd><a href="#">Active</a></dd>
39
+ <dd><a href="#">Pending</a></dd>
40
+ <dd><a href="#">Suspended</a></dd>
41
+ </dl>', :html %>
42
+
43
+ <p>To use these styles, make sure you have the default Foundation CSS package or that you've selected sub-nav from a custom package. These should be linked up following our default <a href="#">HTML page structure</a>.</p>
44
+
45
+ <hr>
46
+
47
+ <h3>Build with our Mixins</h3>
48
+ <p>We've included SCSS mixins used to style sub-nav. To use the mixin, you'll need to have the <a href="#extention-install">extension installed</a> or grab <a href="#">_foundation-global.scss</a> and <a href="#">_sub-nav.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>
49
+
50
+ <%= code_example '
51
+ @import "foundation/foundation-global", "foundation/sub-nav";
52
+ ', :css %>
53
+
54
+ <h5>Quick Mixin</h5>
55
+ <p>You can build your sub-nav using our global mixin by including it on a custom class or ID in your own stylesheet. The mixin contains options for changing the font color, font size and active background color. The rest of the defaults can be modified using the available variables. The global mixin looks like this:</p>
56
+
57
+ <%= code_example '
58
+ /* Using the default styles */
59
+ .your-class-name { @include sub-nav; }', :css %>
60
+
61
+ <p>There are also three options you can customize on the fly when writing this mixin. These controls things like: divider color, text size and font color.</p>
62
+
63
+ <%= code_example '
64
+ /* Using the available options */
65
+ .your-class-name { @include sub-nav($font-color, $font-size, $active-bg); }
66
+
67
+ /* Control the color of the divider between links */
68
+ $font-color: $sub-nav-font-color
69
+
70
+ /* Control your font-size per label */
71
+ $font-size: $sub-nav-font-size
72
+
73
+ /* Change the background color for your labels */
74
+ $active-bg: $sub-nav-active-bg
75
+ ', :css %>
76
+
77
+ <%= code_example '
78
+ /* Using customized options */
79
+ .your-class-name { @include sub-nav(orange, 11px, orange); }
80
+ ', :css %>
81
+
82
+ <dl class="sub-nav-custom">
83
+ <dt>Filter:</dt>
84
+ <dd class="active"><a href="#">All</a></dd>
85
+ <dd><a href="#">Active</a></dd>
86
+ <dd><a href="#">Pending</a></dd>
87
+ <dd><a href="#">Suspended</a></dd>
88
+ </dl>
89
+
90
+
91
+ <h5>Default SCSS Variables</h5>
92
+
93
+ <%= code_example '
94
+ /* We use these to control margin and padding */
95
+ $sub-nav-list-margin: emCalc(-4px) 0 emCalc(18px);
96
+ $sub-nav-list-padding-top: emCalc(4px);
97
+
98
+ /* We use this to control the definition */
99
+ $sub-nav-font-size: emCalc(14px);
100
+ $sub-nav-font-color: #999;
101
+ $sub-nav-font-weight: normal;
102
+ $sub-nav-text-decoration: none;
103
+ $sub-nav-border-radius: 1000px;
104
+
105
+ /* We use these to control the active item styles */
106
+ $sub-nav-active-font-weight: bold;
107
+ $sub-nav-active-bg: $primary-color;
108
+ $sub-nav-active-color: #fff;
109
+ $sub-nav-active-padding: emCalc(3px) emCalc(9px);
110
+ $sub-nav-active-cursor: default;', :css %>
111
+
112
+ <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>
113
+
114
+ </div>
115
+ </div>
116
+ </div>
117
+ <div class="large-3 pull-9 columns">
118
+ <%= render "_sidebar-components.html.erb" %>
119
+ </div>
120
+ </div>
@@ -0,0 +1,288 @@
1
+ <div class="row">
2
+ <div class="large-9 push-3 columns">
3
+
4
+ <% @page_title = "Switch" %>
5
+ <div class="row">
6
+ <div class="large-12 columns">
7
+ <h2><%= @page_title %></h2>
8
+ <h4 class="subheader">Switches can be used instead of regular radio buttons to switch between two options. They are customizable and use styles that won't show on phones that don't support media queries. On these devices, they will appear as regular radio buttons.</h4>
9
+
10
+ <div class="small-2 switch tiny">
11
+ <input id="a" name="switch-a" type="radio" checked>
12
+ <label for="a" onclick="">Off</label>
13
+
14
+ <input id="a1" name="switch-a" type="radio">
15
+ <label for="a1" onclick="">On</label>
16
+
17
+ <span></span>
18
+ </div>
19
+
20
+ <div class="small-3 switch small">
21
+ <input id="b" name="switch-b" type="radio" checked>
22
+ <label for="b" onclick="">Off</label>
23
+
24
+ <input id="b1" name="switch-b" type="radio">
25
+ <label for="b1" onclick="">On</label>
26
+
27
+ <span></span>
28
+ </div>
29
+
30
+ <div class="small-4 switch radius">
31
+ <input id="c" name="switch-c" type="radio" checked>
32
+ <label for="c" onclick="">Off</label>
33
+
34
+ <input id="c1" name="switch-c" type="radio">
35
+ <label for="c1" onclick="">On</label>
36
+
37
+ <span></span>
38
+ </div>
39
+
40
+ <div class="small-6 switch large round">
41
+ <input id="d" name="switch-d" type="radio" checked>
42
+ <label for="d" onclick="">Off</label>
43
+
44
+ <input id="d1" name="switch-d" type="radio">
45
+ <label for="d1" onclick="">On</label>
46
+
47
+ <span></span>
48
+ </div>
49
+
50
+ <hr>
51
+
52
+ </div>
53
+ </div>
54
+
55
+ <div class="row">
56
+ <div class="large-12 columns">
57
+
58
+ <h3>Build With Predefined HTML Classes</h3>
59
+ <p>There are two ways to build switches in Foundation 4: with our predefined HTML classes or with our mixins. Building switches using our predefined classes is simple, you'll just need a <code>div.switch</code> wrapped around a specific input/label markup. From there, you can update the styles as you need to. The switches width is 100% of the container you put it in or you can use our grid classes, <code>.small-#</code> or <code>.large-#</code>, directly on the switch.</p>
60
+
61
+ <%= code_example '
62
+ <!-- Default switch -->
63
+ <div class="switch">
64
+ <input id="x" name="switch-x" type="radio" checked>
65
+ <label for="x" onclick="">Off</label>
66
+
67
+ <input id="x1" name="switch-x" type="radio">
68
+ <label for="x1" onclick="">On</label>
69
+
70
+ <span></span>
71
+ </div>
72
+
73
+ <!-- Using class options -->
74
+ <div class="switch large round">
75
+ <input id="z" name="switch-z" type="radio" checked>
76
+ <label for="z" onclick="">Off</label>
77
+
78
+ <input id="z1" name="switch-z" type="radio">
79
+ <label for="z1" onclick="">On</label>
80
+
81
+ <span></span>
82
+ </div>', :html %>
83
+
84
+ <p>The class options:</p>
85
+ <ul class="disc">
86
+ <li><code>radius</code>: Add this to the the switch container to get a 3px radius paddle and edges</li>
87
+ <li><code>round</code>: Add this to the the switch container to get a round paddle and edges</li>
88
+ <li><code>tiny</code>: Set the height and text of the switch to tiny</li>
89
+ <li><code>small</code>: Set the height and text of the switch to small</li>
90
+ <li><code>large</code>: Set the height and text of the switch to large</li>
91
+ </ul>
92
+
93
+ <p>To use these styles, make sure you have the default Foundation CSS package or that you've selected switches from a custom package. These should be linked up following our default <a href="#">HTML page structure</a>.</p>
94
+
95
+ <hr>
96
+
97
+ <h3>Build with our Mixins</h3>
98
+ <p>We've included SCSS mixins used to style switches. To use the mixin, you'll need to have the <a href="#extention-install">extension installed</a> or grab <a href="#">_foundation-global.scss</a> and <a href="#">_switch.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>
99
+
100
+ <%= code_example '
101
+ @import "foundation/foundation-global", "foundation/switch";
102
+ ', :css %>
103
+
104
+ <p>The markup is pretty simple, you'll only need a single class or ID on the container to apply the mixin.</p>
105
+
106
+ <%= code_example '
107
+ <div class="your-class-name">
108
+ <input id="z" name="switch-z" type="radio" checked>
109
+ <label for="z" onclick="">Off</label>
110
+
111
+ <input id="z1" name="switch-z" type="radio">
112
+ <label for="z1" onclick="">On</label>
113
+
114
+ <span></span>
115
+ </div>
116
+ ', :html %>
117
+
118
+ <h5>Quick Mixin</h5>
119
+ <p>You can build your labels using our global mixin by including it on your custom class or ID in your own stylesheet. The mixin contains options for changing the key styles, the rest of the defaults can be modified using the available variables. The global mixin looks like this:</p>
120
+
121
+ <%= code_example '
122
+ /* Using the default styles */
123
+ .your-class-name { @include switch; }', :css %>
124
+
125
+ <div class="switch">
126
+ <input id="y" name="switch-y" type="radio" checked>
127
+ <label for="y" onclick="">Off</label>
128
+
129
+ <input id="y1" name="switch-y" type="radio">
130
+ <label for="y1" onclick="">On</label>
131
+
132
+ <span></span>
133
+ </div>
134
+
135
+ <p>There are <strong>ten options</strong> you can customize on the fly when writing this mixin. These controls things like: padding, text size, color and radius. Setting any of these options to false will negate those styles.</p>
136
+
137
+ <%= code_example '
138
+ /* Using the available options */
139
+ .your-class-name {
140
+ @include switch($transition-speed, $transition-ease, $height, $font-size, $line-height, $paddle-bg, $positive-color, $negative-color, $radius, $base-style);
141
+ }
142
+
143
+ /* This sets the speed at which the switch toggles */
144
+ $transition-speed: $switch-paddle-transition-speed
145
+
146
+ /* This sets the ease of the switch transition */
147
+ $transition-ease: $switch-paddle-transition-ease
148
+
149
+ /* This controls the overall height of the switch */
150
+ $height: $switch-height-med
151
+
152
+ /* You can set a different font-size for you switch */
153
+ $font-size: $switch-font-size-med
154
+
155
+ /* You can set a different line-height too */
156
+ $line-height: 2.3em
157
+
158
+ /* This controls the background of the paddle */
159
+ $paddle-bg: $switch-paddle-bg
160
+
161
+ /* Set the box-shadow color for the right side of the switch */
162
+ $positive-color: $switch-positive-color
163
+
164
+ /* Set the box-shadow color for the left side of the switch */
165
+ $negative-color: $switch-negative-color
166
+
167
+ /* Set this to true for default radius or any number for complete control */
168
+ $radius: false
169
+
170
+ /* If you set this to false, base styles are left out */
171
+ $base-style: true
172
+ ', :css %>
173
+
174
+ <div class="switch-custom">
175
+ <input id="w" name="switch-w" type="radio" checked>
176
+ <label for="w" onclick="">Off</label>
177
+
178
+ <input id="w1" name="switch-w" type="radio">
179
+ <label for="w1" onclick="">On</label>
180
+
181
+ <span></span>
182
+ </div>
183
+
184
+ <h5>Base Mixin</h5>
185
+ <p>You also have access to a few internal mixins that can create parts of the button as needed. The base mixin will create a switch base that only include structural styles.</p>
186
+
187
+ <%= code_example '
188
+ .your-class-name { @include switch-base($transition-speed, $transition-ease); }
189
+ ', :css %>
190
+
191
+ <div class="switch-custom-base">
192
+ <input id="o" name="switch-o" type="radio" checked>
193
+ <label for="o" onclick="">Off</label>
194
+
195
+ <input id="o1" name="switch-o" type="radio">
196
+ <label for="o1" onclick="">On</label>
197
+
198
+ <span></span>
199
+ </div>
200
+
201
+ <h5>Size Mixin</h5>
202
+ <p>The size mixin will let you control the size of the switch, font-size and line-height.</p>
203
+
204
+ <%= code_example '
205
+ .your-class-name {
206
+ @include switch-base($transition-speed, $transition-ease);
207
+ @include switch-size($height, $font-size, $line-height);
208
+ }
209
+ ', :css %>
210
+
211
+ <div class="switch-custom-base size">
212
+ <input id="o2" name="switch-o2" type="radio" checked>
213
+ <label for="o2" onclick="">Off</label>
214
+
215
+ <input id="o3" name="switch-o2" type="radio">
216
+ <label for="o3" onclick="">On</label>
217
+
218
+ <span></span>
219
+ </div>
220
+
221
+ <h5>Style Mixin</h5>
222
+ <p>The last internal mixin you have access to for buttons is the style mixin. This will help you style background color, text color, positive/negative color, etc.</p>
223
+
224
+ <%= code_example '
225
+ .your-class-name {
226
+ @include switch-base($transition-speed, $transition-ease);
227
+ @include switch-size($height, $font-size, $line-height);
228
+ @include switch-style($paddle-bg, $positive-color, $negative-color, $radius, $base-style);
229
+ }
230
+ ', :css %>
231
+
232
+ <div class="switch-custom-base size style">
233
+ <input id="o4" name="switch-o3" type="radio" checked>
234
+ <label for="o4" onclick="">Off</label>
235
+
236
+ <input id="o5" name="switch-o3" type="radio">
237
+ <label for="o5" onclick="">On</label>
238
+
239
+ <span></span>
240
+ </div>
241
+
242
+ <h5>Default SCSS Variables</h5>
243
+
244
+ <%= code_example '
245
+ /* Controlling border styles and background colors for the switch container */
246
+ $switch-border-color: darken(#fff, 20%);
247
+ $switch-border-style: solid;
248
+ $switch-border-width: 1px;
249
+ $switch-bg: #fff;
250
+
251
+ /* We use these to control the switch heights for our default classes */
252
+ $switch-height-tny: 22px;
253
+ $switch-height-sml: 28px;
254
+ $switch-height-med: 36px;
255
+ $switch-height-lrg: 44px;
256
+ $switch-bottom-margin: emCalc(20px);
257
+
258
+ /* We use these to control default font sizes for our classes. */
259
+ $switch-font-size-tny: 11px;
260
+ $switch-font-size-sml: 12px;
261
+ $switch-font-size-med: 14px;
262
+ $switch-font-size-lrg: 17px;
263
+ $switch-label-side-padding: 6px;
264
+
265
+ /* We use these to style the switch-paddle */
266
+ $switch-paddle-bg: #fff;
267
+ $switch-paddle-fade-to-color: darken($switch-paddle-bg, 10%);
268
+ $switch-paddle-border-color: darken($switch-paddle-bg, 35%);
269
+ $switch-paddle-border-width: 1px;
270
+ $switch-paddle-border-style: solid;
271
+ $switch-paddle-transition-speed: .1s;
272
+ $switch-paddle-transition-ease: ease-out;
273
+ $switch-positive-color: lighten($success-color, 50%);
274
+ $switch-negative-color: #f5f5f5;
275
+
276
+ /* Outline Style for tabbing through switches */
277
+ $switch-label-outline: 1px dotted #888;', :css %>
278
+
279
+ <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>
280
+
281
+ </div>
282
+ </div>
283
+ </div>
284
+ <div class="large-3 pull-9 columns">
285
+ <%= render "_sidebar-components.html.erb" %>
286
+ </div>
287
+
288
+ </div>