zurb-foundation 4.3.1 → 4.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/Gemfile.lock +31 -2
- data/Gruntfile.js +54 -10
- data/LICENSE +2 -2
- data/README.md +11 -2
- data/Rakefile +9 -0
- data/docs/CHANGELOG.md +9 -0
- data/docs/Procfile +2 -2
- data/docs/components/abide.html.erb +30 -6
- data/docs/components/alert-boxes.html.erb +35 -10
- data/docs/components/block-grid.html.erb +1 -1
- data/docs/components/breadcrumbs.html.erb +4 -4
- data/docs/components/button-groups.html.erb +2 -2
- data/docs/components/buttons.html.erb +10 -10
- data/docs/components/clearing.html.erb +28 -2
- data/docs/components/custom-forms.html.erb +9 -1
- data/docs/components/dropdown-buttons.html.erb +36 -11
- data/docs/components/dropdown.html.erb +44 -13
- data/docs/components/flex-video.html.erb +3 -3
- data/docs/components/forms.html.erb +10 -10
- data/docs/components/global.html.erb +15 -20
- data/docs/components/grid.html.erb +24 -23
- data/docs/components/inline-lists.html.erb +3 -3
- data/docs/components/interchange.html.erb +28 -2
- data/docs/components/joyride.html.erb +34 -10
- data/docs/components/keystrokes.html.erb +3 -3
- data/docs/components/kitchen-sink.html.erb +1 -1
- data/docs/components/labels.html.erb +3 -3
- data/docs/components/magellan.html.erb +25 -2
- data/docs/components/orbit.html.erb +39 -9
- data/docs/components/pagination.html.erb +7 -7
- data/docs/components/panels.html.erb +3 -3
- data/docs/components/pricing-tables.html.erb +11 -11
- data/docs/components/progress-bars.html.erb +5 -5
- data/docs/components/reveal.html.erb +31 -8
- data/docs/components/section.html.erb +61 -37
- data/docs/components/side-nav.html.erb +4 -4
- data/docs/components/split-buttons.html.erb +37 -15
- data/docs/components/sub-nav.html.erb +10 -6
- data/docs/components/switch.html.erb +2 -2
- data/docs/components/tables.html.erb +7 -7
- data/docs/components/tooltips.html.erb +30 -6
- data/docs/components/top-bar.html.erb +101 -13
- data/docs/components/type.html.erb +16 -16
- data/docs/config.ru +18 -1
- data/docs/controller.rb +1 -1
- data/docs/css/_coderay.scss +2 -2
- data/docs/css/_footer.scss +7 -7
- data/docs/css/_offcanvas.scss +16 -16
- data/docs/css/docs.scss +1 -3
- data/docs/index.html.erb +29 -29
- data/docs/layout.html.erb +5 -5
- data/docs/media-queries.html.erb +3 -3
- data/docs/rails.html.erb +2 -1
- data/docs/sass.html.erb +188 -146
- data/docs/support.html.erb +2 -2
- data/foundation.gemspec +1 -0
- data/js/foundation/foundation.abide.js +5 -5
- data/js/foundation/foundation.alerts.js +9 -4
- data/js/foundation/foundation.clearing.js +2 -2
- data/js/foundation/foundation.dropdown.js +11 -5
- data/js/foundation/foundation.forms.js +51 -28
- data/js/foundation/foundation.joyride.js +7 -5
- data/js/foundation/foundation.js +25 -1
- data/js/foundation/foundation.magellan.js +3 -2
- data/js/foundation/foundation.orbit.js +78 -58
- data/js/foundation/foundation.placeholder.js +424 -177
- data/js/foundation/foundation.reveal.js +39 -16
- data/js/foundation/foundation.section.js +62 -32
- data/js/foundation/foundation.tooltips.js +3 -2
- data/js/foundation/foundation.topbar.js +139 -69
- data/lib/foundation/generators/templates/application.html.erb +2 -1
- data/lib/foundation/version.rb +1 -1
- data/lib/zurb-foundation.rb +12 -0
- data/package.json +4 -3
- data/scss/foundation/_variables.scss +183 -159
- data/scss/foundation/components/_alert-boxes.scss +8 -8
- data/scss/foundation/components/_block-grid.scss +1 -1
- data/scss/foundation/components/_breadcrumbs.scss +3 -3
- data/scss/foundation/components/_button-groups.scss +2 -2
- data/scss/foundation/components/_buttons.scss +20 -20
- data/scss/foundation/components/_custom-forms.scss +19 -14
- data/scss/foundation/components/_dropdown-buttons.scss +8 -8
- data/scss/foundation/components/_dropdown.scss +4 -4
- data/scss/foundation/components/_flex-video.scss +2 -2
- data/scss/foundation/components/_forms.scss +28 -18
- data/scss/foundation/components/_global.scss +43 -18
- data/scss/foundation/components/_grid-5.scss +4 -4
- data/scss/foundation/components/_grid.scss +6 -4
- data/scss/foundation/components/_inline-lists.scss +3 -3
- data/scss/foundation/components/_joyride.scss +10 -10
- data/scss/foundation/components/_keystrokes.scss +2 -2
- data/scss/foundation/components/_labels.scss +2 -2
- data/scss/foundation/components/_orbit.scss +58 -44
- data/scss/foundation/components/_pagination.scss +6 -6
- data/scss/foundation/components/_panels.scss +7 -4
- data/scss/foundation/components/_pricing-tables.scss +10 -10
- data/scss/foundation/components/_progress-bars.scss +3 -3
- data/scss/foundation/components/_reveal.scss +5 -5
- data/scss/foundation/components/_section.scss +21 -21
- data/scss/foundation/components/_side-nav.scss +3 -3
- data/scss/foundation/components/_split-buttons.scss +7 -7
- data/scss/foundation/components/_sub-nav.scss +26 -10
- data/scss/foundation/components/_switch.scss +15 -11
- data/scss/foundation/components/_tables.scss +6 -6
- data/scss/foundation/components/_thumbs.scss +2 -4
- data/scss/foundation/components/_tooltips.scss +4 -4
- data/scss/foundation/components/_top-bar.scss +77 -39
- data/scss/foundation/components/_type.scss +25 -23
- data/scss/foundation/components/_visibility.scss +28 -28
- data/scss/normalize.scss +22 -14
- data/spec/js/SectionSpec.js +39 -0
- data/spec/js/helpers/SectionSpecHelper.js +22 -0
- data/spec/js/helpers/SpecHelper.js +19 -0
- metadata +32 -25
- data/.rbenv-version +0 -1
@@ -21,7 +21,7 @@
|
|
21
21
|
<div class="large-12 columns">
|
22
22
|
|
23
23
|
<h3>Build With HTML Classes</h3>
|
24
|
-
<p>Reveal modals are easy to build
|
24
|
+
<p>Reveal modals are easy to build. They should live right above your closing <code>body</code> tag, but if they are nested within the document, Reveal will temporarily relocate them while open to ensure proper positioning. Follow the markup below to get started:</p>
|
25
25
|
|
26
26
|
<%= code_example '
|
27
27
|
<div id="myModal" class="reveal-modal">
|
@@ -199,13 +199,13 @@ $reveal-overlay-bg-old: #000;
|
|
199
199
|
$reveal-modal-bg: #fff;
|
200
200
|
$reveal-position-top: 50px;
|
201
201
|
$reveal-default-width: 80%;
|
202
|
-
$reveal-modal-padding:
|
202
|
+
$reveal-modal-padding: em-calc(20);
|
203
203
|
$reveal-box-shadow: 0 0 10px rgba(#000,.4);
|
204
204
|
|
205
205
|
/* We use these to style the reveal close button */
|
206
|
-
$reveal-close-font-size:
|
207
|
-
$reveal-close-top:
|
208
|
-
$reveal-close-side:
|
206
|
+
$reveal-close-font-size: em-calc(22);
|
207
|
+
$reveal-close-top: em-calc(8);
|
208
|
+
$reveal-close-side: em-calc(11);
|
209
209
|
$reveal-close-color: #aaa;
|
210
210
|
$reveal-close-weight: bold;
|
211
211
|
|
@@ -217,15 +217,38 @@ $reveal-border-color: #666;
|
|
217
217
|
$reveal-modal-class: "reveal-modal";
|
218
218
|
$close-reveal-modal-class: "close-reveal-modal";', :css %>
|
219
219
|
|
220
|
-
<p><strong>Note:</strong> <code>
|
220
|
+
<p><strong>Note:</strong> <code>em-calc();</code> is a function we wrote to convert <code>px</code> to <code>em</code>. It is included in <strong>_variables.scss</strong>.</p>
|
221
221
|
|
222
222
|
<hr>
|
223
223
|
|
224
224
|
<h3>Using the JavaScript</h3>
|
225
|
-
<
|
225
|
+
<div class="panel">
|
226
|
+
Before you can use Reveal you'll want to verify that both jQuery (or Zepto) and <code>foundation.js</code> are available on your page. You can refer to the <a href="../javascript.html">javascript documentation</a> on setting that up.
|
227
|
+
</div>
|
226
228
|
|
227
|
-
<p
|
229
|
+
<p>Just add <code>foundation.reveal.js</code> AFTER the <code>foundation.js</code> file. Your markup should look something like this:</p>
|
228
230
|
|
231
|
+
<%= code_example '
|
232
|
+
<body>
|
233
|
+
|
234
|
+
...
|
235
|
+
|
236
|
+
<script>
|
237
|
+
document.write(\'<script src=/js/vendor/\'
|
238
|
+
+ (\'__proto__\' in {} ? \'zepto\' : \'jquery\')
|
239
|
+
+ \'.js><\/script>\');
|
240
|
+
</script>
|
241
|
+
|
242
|
+
<script src="js/foundation/foundation.js"></script>
|
243
|
+
<script src="js/foundation/foundation.reveal.js"></script>
|
244
|
+
<!-- Other JS plugins can be included here -->
|
245
|
+
|
246
|
+
<script>
|
247
|
+
$(document).foundation();
|
248
|
+
</script>
|
249
|
+
|
250
|
+
</body>
|
251
|
+
', :html %>
|
229
252
|
<p>Required Foundation Library: <code>foundation.reveal.js</code></p>
|
230
253
|
|
231
254
|
<h5>Optional JavaScript Configuration</h5>
|
@@ -75,7 +75,7 @@
|
|
75
75
|
<p class="title" data-section-title><a href="#panel2">Section 2</a></p>
|
76
76
|
<div class="content" data-slug="panel2" data-section-content>
|
77
77
|
<div class="section-container auto" data-section data-options="deep_linking: true;">
|
78
|
-
<section data-section-region>
|
78
|
+
<section class="active" data-section-region>
|
79
79
|
<p class="title" data-section-title><a href="#panel2nested1">Section 1</a></p>
|
80
80
|
<div class="content" data-slug="nested1" data-section-content>
|
81
81
|
<p>Section 1. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
@@ -166,7 +166,7 @@
|
|
166
166
|
|
167
167
|
<%= code_example '
|
168
168
|
<div class="section-container auto" data-section>
|
169
|
-
<section>
|
169
|
+
<section class="active">
|
170
170
|
<p class="title" data-section-title><a href="#panel1">Section 1</a></p>
|
171
171
|
<div class="content" data-section-content>
|
172
172
|
<p>Content of section 1.</p>
|
@@ -180,7 +180,7 @@
|
|
180
180
|
</section>
|
181
181
|
</div>', :html %>
|
182
182
|
<div class="section-container auto" data-section>
|
183
|
-
<section>
|
183
|
+
<section class="active">
|
184
184
|
<p class="title" data-section-title><a href="#panel1">Section 1</a></p>
|
185
185
|
<div class="content" data-section-content>
|
186
186
|
<p>Content of section 1.</p>
|
@@ -213,7 +213,7 @@
|
|
213
213
|
<p>Adding an <code>accordion</code> class to the section container will show an accordion on both small and large screens.</p>
|
214
214
|
<%= code_example '
|
215
215
|
<div class="section-container accordion" data-section="accordion">
|
216
|
-
<section>
|
216
|
+
<section class="active">
|
217
217
|
<p class="title" data-section-title><a href="#">Section 1</a></p>
|
218
218
|
<div class="content" data-section-content>
|
219
219
|
<p>Content of section 1.</p>
|
@@ -227,7 +227,7 @@
|
|
227
227
|
</section>
|
228
228
|
</div>', :html %>
|
229
229
|
<div class="section-container accordion" data-section="accordion">
|
230
|
-
<section>
|
230
|
+
<section class="active">
|
231
231
|
<p class="title" data-section-title><a href="#">Section 1</a></p>
|
232
232
|
<div class="content" data-section-content>
|
233
233
|
<p>Content of section 1.</p>
|
@@ -245,7 +245,7 @@
|
|
245
245
|
<p>Adding a <code>tabs</code> class to the section container will enable tabs on both small and large screens.</p>
|
246
246
|
<%= code_example '
|
247
247
|
<div class="section-container tabs" data-section="tabs">
|
248
|
-
<section>
|
248
|
+
<section class="active">
|
249
249
|
<p class="title" data-section-title><a href="#">Section 1</a></p>
|
250
250
|
<div class="content" data-section-content>
|
251
251
|
<p>Content of section 1.</p>
|
@@ -260,7 +260,7 @@
|
|
260
260
|
</div>', :html %>
|
261
261
|
|
262
262
|
<div class="section-container tabs" data-section="tabs">
|
263
|
-
<section>
|
263
|
+
<section class="active">
|
264
264
|
<p class="title" data-section-title><a href="#">Section 1</a></p>
|
265
265
|
<div class="content" data-section-content>
|
266
266
|
<p>Content of section 1.</p>
|
@@ -279,7 +279,7 @@
|
|
279
279
|
|
280
280
|
<%= code_example '
|
281
281
|
<div class="section-container vertical-tabs" data-section="vertical-tabs">
|
282
|
-
<section>
|
282
|
+
<section class="active">
|
283
283
|
<p class="title" data-section-title><a href="#">Section 1</a></p>
|
284
284
|
<div class="content" data-section-content>
|
285
285
|
<p>Content of section 1.</p>
|
@@ -300,7 +300,7 @@
|
|
300
300
|
</div>', :html %>
|
301
301
|
|
302
302
|
<div class="section-container vertical-tabs" data-section="vertical-tabs">
|
303
|
-
<section>
|
303
|
+
<section class="active">
|
304
304
|
<p class="title" data-section-title><a href="#">Section 1</a></p>
|
305
305
|
<div class="content" data-section-content>
|
306
306
|
<p>Content of section 1.</p>
|
@@ -464,7 +464,7 @@
|
|
464
464
|
|
465
465
|
<%= code_example '
|
466
466
|
<div class="section-container auto" data-section data-options="deep_linking: true">
|
467
|
-
<section>
|
467
|
+
<section class="active">
|
468
468
|
<p class="title" data-section-title><a href="#section1">Section 1</a></p>
|
469
469
|
<div class="content" data-slug="section1" data-section-content>
|
470
470
|
<p>Content of section 1.</p>
|
@@ -482,7 +482,7 @@
|
|
482
482
|
<p>You can infinitely nest Section elements to create more complicated Section layouts.</p>
|
483
483
|
|
484
484
|
<div class="section-container auto" data-section>
|
485
|
-
<section>
|
485
|
+
<section class="active">
|
486
486
|
<p class="title"><a href="#section1">ROOT: Section 1</a></p>
|
487
487
|
<div class="content" data-slug="section1">
|
488
488
|
<p>Content 1 Summary Paragraphs</p>
|
@@ -511,7 +511,7 @@
|
|
511
511
|
</div>
|
512
512
|
<%= code_example '
|
513
513
|
<div class="section-container auto" data-section>
|
514
|
-
<section>
|
514
|
+
<section class="active">
|
515
515
|
<p class="title"><a href="#section1">ROOT: Section 1</a></p>
|
516
516
|
<div class="content" data-slug="section1">
|
517
517
|
<p>Content 1 Summary Paragraphs</p>
|
@@ -594,7 +594,7 @@ $title-selector: ".title"
|
|
594
594
|
/* You can set the class that is used for the content elements */
|
595
595
|
$content-selector: ".content"
|
596
596
|
|
597
|
-
/* Give the titles some padding, can be any px or
|
597
|
+
/* Give the titles some padding, can be any px or em-calc() value */
|
598
598
|
$title-padding: $section-padding
|
599
599
|
|
600
600
|
/* give the titles a color, any color value */
|
@@ -637,7 +637,7 @@ $section-border-color: $section-border-color', :css %>
|
|
637
637
|
<p>The default use case for our section plugin is to create accordions on small screens and tabs on large screens.</p>
|
638
638
|
<%= code_example '
|
639
639
|
<div class="section-auto-sample" data-section="auto">
|
640
|
-
<section>
|
640
|
+
<section class="active">
|
641
641
|
<p class="title-sample" data-section-title><a href="#section1">Section 1</a></p>
|
642
642
|
<div class="content-sample" data-slug="section1" data-section-content>
|
643
643
|
<p>Content of section 1.</p>
|
@@ -663,7 +663,7 @@ $section-border-color: $section-border-color', :css %>
|
|
663
663
|
}', :sass %>
|
664
664
|
|
665
665
|
<div class="section-auto-sample" data-section="auto">
|
666
|
-
<section>
|
666
|
+
<section class="active">
|
667
667
|
<p class="title-sample" data-section-title><a href="#section1">Section 1</a></p>
|
668
668
|
<div class="content-sample" data-slug="section1" data-section-content>
|
669
669
|
<p>Content of section 1.</p>
|
@@ -683,7 +683,7 @@ $section-border-color: $section-border-color', :css %>
|
|
683
683
|
<p>You can have your section act like an accordion the entire time, like so:</p>
|
684
684
|
<%= code_example '
|
685
685
|
<div class="section-auto-sample-accordion" data-section="accordion">
|
686
|
-
<section>
|
686
|
+
<section class="active">
|
687
687
|
<p class="title-sample" data-section-title><a href="#section1">Section 1</a></p>
|
688
688
|
<div class="content-sample" data-slug="section1" data-section-content>
|
689
689
|
<p>Content of section 1.</p>
|
@@ -704,7 +704,7 @@ $section-border-color: $section-border-color', :css %>
|
|
704
704
|
}', :sass %>
|
705
705
|
|
706
706
|
<div class="section-auto-sample-accordion" data-section="accordion">
|
707
|
-
<section>
|
707
|
+
<section class="active">
|
708
708
|
<p class="title-sample" data-section-title><a href="#section1">Section 1</a></p>
|
709
709
|
<div class="content-sample" data-slug="section1" data-section-content>
|
710
710
|
<p>Content of section 1.</p>
|
@@ -724,7 +724,7 @@ $section-border-color: $section-border-color', :css %>
|
|
724
724
|
<p>You can have your section act like tabs the entire time, like so:</p>
|
725
725
|
<%= code_example '
|
726
726
|
<div class="section-auto-sample-tabs" data-section="tabs">
|
727
|
-
<section>
|
727
|
+
<section class="active">
|
728
728
|
<p class="title-sample" data-section-title><a href="#section1">Section 1</a></p>
|
729
729
|
<div class="content-sample" data-slug="section1" data-section-content>
|
730
730
|
<p>Content of section 1.</p>
|
@@ -745,7 +745,7 @@ $section-border-color: $section-border-color', :css %>
|
|
745
745
|
}', :sass %>
|
746
746
|
|
747
747
|
<div class="section-auto-sample-tabs" data-section="tabs">
|
748
|
-
<section>
|
748
|
+
<section class="active">
|
749
749
|
<p class="title-sample" data-section-title><a href="#section1">Section 1</a></p>
|
750
750
|
<div class="content-sample" data-slug="section1" data-section-content>
|
751
751
|
<p>Content of section 1.</p>
|
@@ -765,7 +765,7 @@ $section-border-color: $section-border-color', :css %>
|
|
765
765
|
<p>You can have your section act like vertical tabs on large screen and go back to accordion on small screens, like so:</p>
|
766
766
|
<%= code_example '
|
767
767
|
<div class="section-auto-sample-vtabs" data-section="vertical-tabs">
|
768
|
-
<section>
|
768
|
+
<section class="active">
|
769
769
|
<p class="title-sample" data-section-title><a href="#section1">Section 1</a></p>
|
770
770
|
<div class="content-sample" data-slug="section1" data-section-content>
|
771
771
|
<p>Content of section 1.</p>
|
@@ -792,7 +792,7 @@ $section-border-color: $section-border-color', :css %>
|
|
792
792
|
}', :sass %>
|
793
793
|
|
794
794
|
<div class="section-auto-sample-vtabs" data-section="vertical-tabs">
|
795
|
-
<section>
|
795
|
+
<section class="active">
|
796
796
|
<p class="title-sample" data-section-title><a href="#section1">Section 1</a></p>
|
797
797
|
<div class="content-sample" data-slug="section1" data-section-content>
|
798
798
|
<p>Content of section 1.</p>
|
@@ -923,7 +923,7 @@ $section-border-color: $section-border-color', :css %>
|
|
923
923
|
<p>You have access to a few options that will make styling the sections really easy and you can add onto it as you want. You'll still need the data-section attribute to match the style you give the mixin.</p>
|
924
924
|
<%= code_example '
|
925
925
|
<div class="section-auto-sample-custom" data-section="tabs">
|
926
|
-
<section>
|
926
|
+
<section class="active">
|
927
927
|
<p class="title-sample" data-section-title><a href="#section1">Section 1</a></p>
|
928
928
|
<div class="content-sample" data-slug="section1" data-section-content>
|
929
929
|
<p>Content of section 1.</p>
|
@@ -944,7 +944,7 @@ $section-border-color: $section-border-color', :css %>
|
|
944
944
|
}', :sass %>
|
945
945
|
|
946
946
|
<div class="section-auto-sample-custom" data-section="tabs">
|
947
|
-
<section>
|
947
|
+
<section class="active">
|
948
948
|
<p class="title-sample" data-section-title><a href="#section1">Section 1</a></p>
|
949
949
|
<div class="content-sample" data-slug="section1" data-section-content>
|
950
950
|
<p>Content of section 1.</p>
|
@@ -965,8 +965,8 @@ $section-border-color: $section-border-color', :css %>
|
|
965
965
|
$include-html-section-classes: $include-html-classes;
|
966
966
|
|
967
967
|
/* We use these to set padding and hover factor */
|
968
|
-
$section-title-padding:
|
969
|
-
$section-content-padding:
|
968
|
+
$section-title-padding: em-calc(15);
|
969
|
+
$section-content-padding: em-calc(15);
|
970
970
|
$section-function-factor: 10%;
|
971
971
|
|
972
972
|
/* These style the titles */
|
@@ -983,35 +983,58 @@ $section-border-style: solid;
|
|
983
983
|
$section-border-color: #ccc;
|
984
984
|
|
985
985
|
/* Font controls */
|
986
|
-
$section-font-size:
|
986
|
+
$section-font-size: em-calc(14);
|
987
987
|
|
988
988
|
/* Control the color of the background and some size options */
|
989
989
|
$section-content-bg: #fff;
|
990
|
-
$section-vertical-nav-min-width:
|
991
|
-
$section-vertical-tabs-title-width:
|
992
|
-
$section-bottom-margin:
|
990
|
+
$section-vertical-nav-min-width: em-calc(200);
|
991
|
+
$section-vertical-tabs-title-width: em-calc(200);
|
992
|
+
$section-bottom-margin: em-calc(20);
|
993
993
|
|
994
994
|
$title-selector: ".title";
|
995
995
|
$content-selector: ".content";
|
996
996
|
$active-region-selector: ".active";
|
997
997
|
', :css %>
|
998
998
|
|
999
|
-
<p><strong>Note:</strong> <code>
|
999
|
+
<p><strong>Note:</strong> <code>em-calc();</code> is a function we wrote to convert <code>px</code> to <code>em</code>.</p>
|
1000
1000
|
|
1001
1001
|
<hr>
|
1002
1002
|
|
1003
1003
|
<h3>Using the JavaScript</h3>
|
1004
|
-
<
|
1004
|
+
<div class="panel">
|
1005
|
+
Before you can use sections you'll want to verify that both jQuery (or Zepto) and <code>foundation.js</code> are available on your page. You can refer to the <a href="../javascript.html">javascript documentation</a> on setting that up.
|
1006
|
+
</div>
|
1007
|
+
|
1008
|
+
<p>Just add <code>foundation.section.js</code> AFTER the <code>foundation.js</code> file. Your markup should look something like this:</p>
|
1009
|
+
|
1010
|
+
<%= code_example '
|
1011
|
+
<body>
|
1012
|
+
|
1013
|
+
...
|
1005
1014
|
|
1006
|
-
|
1015
|
+
<script>
|
1016
|
+
document.write(\'<script src=/js/vendor/\'
|
1017
|
+
+ (\'__proto__\' in {} ? \'zepto\' : \'jquery\')
|
1018
|
+
+ \'.js><\/script>\');
|
1019
|
+
</script>
|
1007
1020
|
|
1021
|
+
<script src="js/foundation/foundation.js"></script>
|
1022
|
+
<script src="js/foundation/foundation.section.js"></script>
|
1023
|
+
<!-- Other JS plugins can be included here -->
|
1024
|
+
|
1025
|
+
<script>
|
1026
|
+
$(document).foundation();
|
1027
|
+
</script>
|
1028
|
+
|
1029
|
+
</body>
|
1030
|
+
', :html %>
|
1008
1031
|
<p>Required Foundation Library: <code>foundation.section.js</code></p>
|
1009
1032
|
|
1010
1033
|
<p>Then, you'll need to add a data-attribute to make the JS work properly on that element. That looks like:</p>
|
1011
1034
|
|
1012
1035
|
<%= code_example '
|
1013
1036
|
<div class="section-container auto" data-section>
|
1014
|
-
<section>
|
1037
|
+
<section class="active">
|
1015
1038
|
<p class="title" data-section-title><a href="#panel1">Section 1</a></p>
|
1016
1039
|
<div class="content" data-section-content>
|
1017
1040
|
<ul class="side-nav">
|
@@ -1052,10 +1075,11 @@ $('#myModal').on('opened', function () {
|
|
1052
1075
|
|
1053
1076
|
<%= code_example "
|
1054
1077
|
{
|
1055
|
-
deep_linking: false,
|
1056
|
-
one_up: true,
|
1057
|
-
|
1058
|
-
|
1078
|
+
deep_linking: false, // Allows for querystring hashtag direct linking
|
1079
|
+
one_up: true, // Ensures the first section is shown on initial view
|
1080
|
+
multi_expand: false, // For accordion, allows more than one section to be expanded at the same time.
|
1081
|
+
rtl: false, // Flags for right-to-left behavior
|
1082
|
+
callback: function (){} // Called when a section is selected.
|
1059
1083
|
}", :js %>
|
1060
1084
|
|
1061
1085
|
</div>
|
@@ -99,17 +99,17 @@ $link-color: $side-nav-link-color
|
|
99
99
|
$include-html-nav-classes: $include-html-classes;
|
100
100
|
|
101
101
|
/* We use this to control padding. */
|
102
|
-
$side-nav-padding:
|
102
|
+
$side-nav-padding: em-calc(14 0);
|
103
103
|
|
104
104
|
/* We use these to control list styles. */
|
105
105
|
$side-nav-list-type: none;
|
106
106
|
$side-nav-list-position: inside;
|
107
|
-
$side-nav-list-margin:
|
107
|
+
$side-nav-list-margin: em-calc(0 0 7 0);
|
108
108
|
|
109
109
|
/* We use these to control link styles. */
|
110
110
|
$side-nav-link-color: $primary-color;
|
111
111
|
$side-nav-link-color-active: lighten(#000, 30%);
|
112
|
-
$side-nav-font-size:
|
112
|
+
$side-nav-font-size: em-calc(14);
|
113
113
|
$side-nav-font-weight: bold;
|
114
114
|
|
115
115
|
/* We use these to control border styles */
|
@@ -117,7 +117,7 @@ $side-nav-divider-size: 1px;
|
|
117
117
|
$side-nav-divider-style: solid;
|
118
118
|
$side-nav-divider-color: darken(#fff, 10%);', :css %>
|
119
119
|
|
120
|
-
<p><strong>Note:</strong> <code>
|
120
|
+
<p><strong>Note:</strong> <code>em-calc();</code> is a function we wrote to convert <code>px</code> to <code>em</code>. It is included in <strong>_variables.scss</strong>.</p>
|
121
121
|
|
122
122
|
</div>
|
123
123
|
</div>
|
@@ -20,7 +20,7 @@
|
|
20
20
|
<li><a href="#">This is another</a></li>
|
21
21
|
<li><a href="#">Yet another</a></li>
|
22
22
|
</ul>
|
23
|
-
|
23
|
+
|
24
24
|
<a href="#" class="small secondary radius button split">Split Button <span data-dropdown="drop2"></span></a><br>
|
25
25
|
<ul id="drop2" class="f-dropdown" data-dropdown-content>
|
26
26
|
<li><a href="#">This is a link</a></li>
|
@@ -34,7 +34,7 @@
|
|
34
34
|
<li><a href="#">This is another</a></li>
|
35
35
|
<li><a href="#">Yet another</a></li>
|
36
36
|
</ul>
|
37
|
-
|
37
|
+
|
38
38
|
<a href="#" class="large success button split">Split Button <span data-dropdown="drop4"></span></a><br>
|
39
39
|
<ul id="drop4" class="f-dropdown" data-dropdown-content>
|
40
40
|
<li><a href="#">This is a link</a></li>
|
@@ -147,47 +147,69 @@ $split-button-padding-tny: $button-tny * 9;
|
|
147
147
|
$split-button-span-width-tny: $button-tny * 6.5;
|
148
148
|
$split-button-pip-size-tny: $button-tny;
|
149
149
|
$split-button-pip-top-tny: $button-tny * 2;
|
150
|
-
$split-button-pip-default-float-tny:
|
150
|
+
$split-button-pip-default-float-tny: em-calc(-5);
|
151
151
|
|
152
152
|
/* We use these to control small split buttons */
|
153
153
|
$split-button-padding-sml: $button-sml * 7;
|
154
154
|
$split-button-span-width-sml: $button-sml * 5;
|
155
155
|
$split-button-pip-size-sml: $button-sml;
|
156
156
|
$split-button-pip-top-sml: $button-sml * 1.5;
|
157
|
-
$split-button-pip-default-float-sml:
|
157
|
+
$split-button-pip-default-float-sml: em-calc(-9);
|
158
158
|
|
159
159
|
/* We use these to control medium split buttons */
|
160
160
|
$split-button-padding-med: $button-med * 6.4;
|
161
161
|
$split-button-span-width-med: $button-med * 4;
|
162
|
-
$split-button-pip-size-med: $button-med -
|
162
|
+
$split-button-pip-size-med: $button-med - em-calc(3);
|
163
163
|
$split-button-pip-top-med: $button-med * 1.5;
|
164
|
-
$split-button-pip-default-float-med:
|
164
|
+
$split-button-pip-default-float-med: em-calc(-9);
|
165
165
|
|
166
166
|
/* We use these to control large split buttons */
|
167
167
|
$split-button-padding-lrg: $button-lrg * 6;
|
168
168
|
$split-button-span-width-lrg: $button-lrg * 3.75;
|
169
|
-
$split-button-pip-size-lrg: $button-lrg -
|
170
|
-
$split-button-pip-top-lrg: $button-lrg +
|
171
|
-
$split-button-pip-default-float-lrg:
|
169
|
+
$split-button-pip-size-lrg: $button-lrg - em-calc(6);
|
170
|
+
$split-button-pip-top-lrg: $button-lrg + em-calc(5);
|
171
|
+
$split-button-pip-default-float-lrg: em-calc(-9);
|
172
172
|
', :css %>
|
173
173
|
|
174
|
-
<p><strong>Note:</strong> <code>
|
174
|
+
<p><strong>Note:</strong> <code>em-calc();</code> is a function we wrote to convert <code>px</code> to <code>em</code>. It is included in <strong>_variables.scss</strong>.</p>
|
175
175
|
|
176
176
|
<hr>
|
177
177
|
|
178
178
|
<h3>Using the JavaScript</h3>
|
179
|
-
<
|
180
|
-
|
179
|
+
<div class="panel">
|
180
|
+
Before you can use split buttons you'll want to verify that both jQuery (or Zepto) and <code>foundation.js</code> are available on your page. You can refer to the <a href="../javascript.html">javascript documentation</a> on setting that up.
|
181
|
+
</div>
|
182
|
+
|
183
|
+
<p>Just add <code>foundation.dropdown.js</code> AFTER the <code>foundation.js</code> file. Your markup should look something like this:</p>
|
184
|
+
|
185
|
+
<%= code_example '
|
186
|
+
<body>
|
187
|
+
|
188
|
+
...
|
189
|
+
|
190
|
+
<script>
|
191
|
+
document.write(\'<script src=/js/vendor/\'
|
192
|
+
+ (\'__proto__\' in {} ? \'zepto\' : \'jquery\')
|
193
|
+
+ \'.js><\/script>\');
|
194
|
+
</script>
|
195
|
+
|
196
|
+
<script src="js/foundation/foundation.js"></script>
|
197
|
+
<script src="js/foundation/foundation.dropdown.js"></script>
|
198
|
+
<!-- Other JS plugins can be included here -->
|
181
199
|
|
182
|
-
|
200
|
+
<script>
|
201
|
+
$(document).foundation();
|
202
|
+
</script>
|
183
203
|
|
204
|
+
</body>
|
205
|
+
', :html %>
|
184
206
|
<p>Required Foundation Library: <code>foundation.dropdown.js</code></p>
|
185
207
|
|
186
208
|
<h5>Creating the Dropdown</h5>
|
187
209
|
<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>
|
188
210
|
|
189
211
|
<%= code_example '
|
190
|
-
<a href="#"
|
212
|
+
<a href="#" class="button split">Dropdown Button <span data-dropdown="drop1"></span></a>
|
191
213
|
<ul id="drop1" class="f-dropdown" data-dropdown-content>
|
192
214
|
<li><a href="#">This is a link</a></li>
|
193
215
|
<li><a href="#">This is another</a></li>
|
@@ -208,7 +230,7 @@ $split-button-pip-default-float-lrg: emCalc(-9);
|
|
208
230
|
|
209
231
|
<p>Dropdown button options can only be passed in during initialization at this time.</p>
|
210
232
|
|
211
|
-
<%= code_example "{
|
233
|
+
<%= code_example "{
|
212
234
|
// specify the class used for active sections
|
213
235
|
activeClass: 'open'
|
214
236
|
}", :js %>
|