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

Feature - Foundation.MediaQuery.is() Method #9008

Merged
merged 2 commits into from Oct 6, 2016

Conversation

Projects
None yet
3 participants
@auginator
Copy link
Contributor

auginator commented Jul 7, 2016

I was thinking this would be a good way for plugins to target a specific breakpoint, rather than being limited to a minimum breakpoint, as they are now with atLeast(). Accepts either ‘[breakpoint] only’ or ‘[breakpoint]’ - in the former case, it will see if the breakpoint matches exactly, and in the latter, it falls back to atLeast().

For instance: #8864

@brettsmason @rafibomb - Any thoughts on this? I would be happy to take a stab at integrating this into the plugins if the community thinks it is worthwhile.

PS: It's my first attempt at contributing to Foundation - I hope I did not donk things up too badly!

Added proposed public is() method for use in plugins
Accepts either ‘[breakpoint] only’ or ‘[breakpoint]’ - in the former
case, it will see if the breakpoint matches exactly, and in the latter,
it falls back to atLeast(). I was thinking this would be a good way for
plugins to target a specific breakpoint, rather than being limited to
atLeast.

@rafibomb rafibomb added this to the 6.3 milestone Jul 11, 2016

@rafibomb

This comment has been minimized.

Copy link
Contributor

rafibomb commented Jul 11, 2016

This is a cool feature - so if I read it right this will allow data-equalize-on="medium only"

@rafibomb

This comment has been minimized.

Copy link
Contributor

rafibomb commented Jul 11, 2016

We'll pull it down and test it - thanks for pointing to 6.3!

@auginator

This comment has been minimized.

Copy link
Contributor Author

auginator commented Jul 11, 2016

I would still have to change methods on the plugins that use Foundation.MediaQuery to use this function instead of the atLeast() method, but I am more than willing to give it a shot and update the pull request.

Happy I got the version number for feature requests right!

Example implimentation
– Fixed a derp in the mediaQuery is method’s conditional check for the
length of the string.
- Replaced atLeast() with new is() method in equalizer, tooltip and
sticky
@auginator

This comment has been minimized.

Copy link
Contributor Author

auginator commented Jul 14, 2016

I updated the branch with a few changes :) Now it works as planned with Equalizer, Tooltip, and Sticky. Cheers!

Equalizer:
<div class="row" data-equalizer data-equalize-on="medium only" id="the-equal">...</div>

Sticky:
<h3 class="callout" data-sticky data-stick-to="bottom" data-sticky-on="medium only">I stick on medium only!</h3>

Tooltip: (I must admit this one seems a little weird to me, not sure if it would practically be that useful.)
<span data-tooltip data-show-on="small only" …>…</span>

@auginator

This comment has been minimized.

Copy link
Contributor Author

auginator commented Jul 21, 2016

@rafibomb I forgot to @ mention you when I updated the branch one week ago.

@kball

This comment has been minimized.

Copy link
Collaborator

kball commented Oct 6, 2016

I like this. Nice work.

@kball kball merged commit 7ff39a7 into zurb:v6.3 Oct 6, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.