Sage 9 and Foundation JS
I’m using the latest Sage 9.0.0-beta.2 release in conjunction with Foundation as the CSS framework. The CSS/SASS is working fine but I got a strange bug with the JS.
I’m trying to use the Foundation.MediaQuery to read the current browser size. It doesn’t return what I expected. The .current alway’s returns undefined when using yarn watch. When using yarn build it does work…
The _init function of Foundation.MediaQuery does the following:
var extractedStyles = $('.foundation-mq').css('font-family');
When logging this to the console it returns ‘Times’ instead of what is should be. It looks like it does this before the object is rendered or such.
Any idea how to let Foundation wait for foundation-mq?
import 'jquery'; import 'foundation-sites/dist/js/foundation'; import Router from './util/Router'; import common from './routes/common'; import home from './routes/home';
$(document).foundation(); is called