Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is Foundation media queries not working when i use a breakpoint name? #12517

Open
mannclay opened this issue Dec 16, 2022 · 2 comments
Open

Comments

@mannclay
Copy link

  I have tested other JS components like accordions and they work fine. For some reason media queries are not working as expected. 

For example:
.header-first, .header-second { @include breakpoint(medium) { background: $cerulean; } }

compiles to the below where the name of the breakpoint is added but not the size of 640px as in the _settings.scss:

@media (min-width: medium) { .header .header-first, .header .header-second { background: #0098db;} }

I have tested that _settings.scss is working by customizing other components. I have also tested that the JS is working with:
console.log('Current: ' + Foundation.MediaQuery.current)

Any hints on what going on?

Originally posted by @mannclay in https://github.com/foundation/foundation-sites/discussions/12516

@mannclay mannclay changed the title I have tested other JS components like accordions and they work fine. For some reason media queries are not working as expected. Why is Foundation media queries not working when i use a breakpoint name? Dec 19, 2022
@L1quid
Copy link

L1quid commented Jan 12, 2023

I am having this issue with Javascript, too.

Unknown breakpoint "medium" passed to MediaQuery.next(). Ensure it is present in your Sass "$breakpoints" setting.

medium definitely exists as a breakpoint...

@L1quid
Copy link

L1quid commented May 26, 2023

Most likely you have an external font failing to load, and this seems to prevent Foundation from passing the breakpoints to Javascript via CSS font-family directive.

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

No branches or pull requests

2 participants