-
Notifications
You must be signed in to change notification settings - Fork 619
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
use CSS queries #718
use CSS queries #718
Conversation
Downloaded your fork and built it, but it doesn't solve what my issue was that it doesn't flip based on current view-port, now it seems like the default is always up, am I missing something? |
@justin-duncan you are right, sorry, seems like need to remove more code here. |
Yeah, that's much better if its more efficient, appreciated @tinovyatkin. |
@justin-duncan it's more efficient at least due to fact that it doesn't causes extra reflow(s) here. And way less code, until @jshjohnson knows some side effect these code had. |
This works really nicely 👍 I can't stand dealing with window/document heights and widths in javascript... |
Two small changes related to more effective use of CSS queries in JS:
window.matchMedia('min-height')
instead of (incorrect) window height calculation (supersedes Updated windowHeight to be based on viewport #633, sorry @justin-duncan 🤷🏼♂️)last-of-type
instead ofquerySelectorAll().pop
😮And one change to SCSS to use
visibility: hidden
instead ofdisplay: none
to prevent one extra reflow on reveal.