If you are searching for Foundation for Sites 6 go and check the official package:
meteor add juliancwirko:zf5
Then you will be able to import all (or chosen) Foundation partials in your main .scss file:
@charset "UTF-8";
@import "{juliancwirko:zf5}/scss/normalize.scss";
// local Foundation settings file.
// You can overwrite the settings here.
// Copy it from git repo -> scss/foundation/_settings.scss near main .scss file.
// Inside the file replace the functions 'foundation/functions' import path
// with '{juliancwirko:zf5}/scss/foundation/functions'
// Then Uncomment the line below:
// @import "settings";
@import "{juliancwirko:zf5}/scss/foundation/components/grid.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/accordion.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/alert-boxes.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/block-grid.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/breadcrumbs.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/button-groups.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/buttons.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/clearing.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/dropdown.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/dropdown-buttons.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/flex-video.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/forms.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/icon-bar.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/inline-lists.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/joyride.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/keystrokes.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/labels.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/magellan.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/orbit.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/pagination.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/panels.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/pricing-tables.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/progress-bars.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/range-slider.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/reveal.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/side-nav.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/split-buttons.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/sub-nav.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/switches.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/tables.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/tabs.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/thumbs.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/tooltips.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/top-bar.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/type.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/offcanvas.scss";
@import "{juliancwirko:zf5}/scss/foundation/components/visibility.scss";
// instead importing partials you can import all in one import. If you want to do this remove all imports above and uncomment the one below
// @import "{juliancwirko:zf5}/scss/foundation.scss";
// your project styles goes here
remember that you can choose components you want. Go and read more on the Foundataion docs.
There is no simple way to init foundation js once :/ but you have a couple of options, you can:
Run Foundation reflow each time you will be loading templates with Foundation js plugins:
Template.subtemplateOflayout.rendered = function () {
$(document).foundation('reflow');
}
You can call foundation reflow on templates which use Foundation js plugins like reveal, top bars etc.
Run Foundation init when subtemplates are rendered but only for specific plugins like:
Template.subtemplateOflayout.rendered = function () {
$(document).foundation({
reveal : {
animation_speed: 500
},
tooltip : {
disable_for_touch: true
},
topbar : {
custom_back_text: false,
is_hover: false,
mobile_show_parent_link: true
}
});
}
You will find more info at: Foundation JavaScript Docs
If you are using Iron Router you can use
Router.onAfterAction(function () {
$(document).foundation(); // or single plugin
});
More: Iron Router Hooks Docs
The basic logic is to run initialization or init it with reflow on element actually presented in the DOM. We don't have here 'document ready' callback. So we need to plug into templates lifetime cycle callbacks. Usage with Meteor isn't so simple. It needs some time to use to it.
Iron.Location.configure({useHashPaths:false})
Thanks to @sveinburne
juliancwirko:zf5
and fourseven:scss
and then add juliancwirko:zf5
See: #9