Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

Foundation.MediaQuery.current ALWAYS returns 'xxlarge' on Safari (9.0.2) #354

Open
jared83 opened this issue Feb 18, 2016 · 1 comment
Open

Comments

@jared83
Copy link

jared83 commented Feb 18, 2016

OSX is El Capitan. Chrome works fine, so I guess it's a problem with Safari.
No matter how I resize the Safari's window, it remains xxlarge.
My javascript takes advatnage of Foundation.MediaQuery.current, so it's crucial to get it respond on Safari properly.
The reported result is from from Safari's console, so surely it's got nothing to do with my coding.
regards

@jared83 jared83 changed the title Foundation.MediaQuery.current ALWAYS returns 'xxlarge' on Safari Foundation.MediaQuery.current ALWAYS returns 'xxlarge' on Safari (9.0.2) Feb 18, 2016
@jared83
Copy link
Author

jared83 commented Feb 18, 2016

Sooo... It turns out that in the end it was my fault... sort of...
In the _settings.scss my $breakpoints look as follows:

$breakpoints: (
  small: 0,
  medium: 640px,
  large: 1024px,
  xlarge: 999999999px,
  xxlarge: 9999999999px,
);

If I return these values to default ones, Safari started to respond properly. I did set such large values on purpose, to make sure that the xlarge and xxlarge breakpoints can never be hit on any device/browser. Apparently Safari does hit such large breakpoints indiscriminately. Not sure if this should be considered a bug with Foundation, or Safari itself.
I would be grateful for any advice on how make sure these breakpoints can never be hit on all browsers in a better way. I did try simply removing the two largest breakpoints, but sass didn't like it, saying:

WARNING: breakpoint(): the media query "large only" cannot be used because large is the largest breakpoint.

Even so, I managed to get it all working in Safari by leaving these two breakpoints out. The constant warnings from sass whenever I save a file are annoying though.
I also wonder if leaving these breakpoints out won't influence any of the Foundation's js plugins or scss.
Anyone knows how to suppress the warnings from sass in gulp?
cheers

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant