Importing Foundation 6 Motion-UI into Sage

I’m new to sage and this method of WordPress development, and am loving it so far.

I’m having a difficult time understanding how to integrate Foundation 6’s ‘Motion UI’ into my sage site so that I can animate (hide/show) my foundation based mobile menu.

Here’s what I’m trying to use:

Based on the news in this thread:
I can’t use the menu-toggle feature unless Motion-UI is imported.

Here’s what I’ve tried:

  • Importing the foundation.responsiveToggle.js file by putting it in the ‘assets/scripts/’ folder > adding the wp_enqueue_script to setup.php, then including the code in manifest.js in the ‘assets’ folder:

“foundation.responsiveToggle.js”: {
“vendor”: [

bower install motion-ui --save-dev

Then the Motion UI Install page says you’re supposed to include the following, somehow:

includePaths: [‘node_modules/motion-ui/src’]

I’m not sure how or where to include that, or where the next line of code should show up:

@import ‘motion-ui’

I appreciate whatever help can be provided. Let me know if I should be importing this using a different method. Again, the whole point is to just get the mobile menu to show/hide the nav content, which it doesn’t do, out of the box, from what I can tell.

It sounds like you should familiarize yourself with the asset-builder/manifest.json to help you out here. I’m not sure exactly how you’re wanting to do this but you’re on the right track.

After running bower install motion-ui --save (not --save-dev) you can see that motion-ui has been added to your bower.json under “dependencies”. Then underneath your dependencies you can override which files you want to actually use, maybe something such as:


"dependencies": {
  "foundation-sites": "^6.2.0",
  "motion-ui": "^1.2.2"
"overrides": {
  "foundation-sites": {
    "main": [
  "motion-ui": {
    "main": [

So that prepares the files to be combined/concatenated with gulp. But we can define what files go together in our manifest.json, such as:


"dependencies": {
"main.js": {
  "files": [
  "bower": [
  "main": true
"main.css": {
  "files": [
  "main": true

If you noticed I only defined what to do with the JS files. This is because Sage uses wiredep which will inject any SASS dependencies directly into your main.scss. If you run gulp at this point you should see both Foundation and MotionUI are now included in main.scss.

1 Like