June 15, 2015 03:28 pm GMT
Original Link: https://www.lullabot.com/blog/article/importing-css-breakpoints-javascript
Importing CSS Breakpoints Into JavaScript
Say you need your JavaScript to do something when a CSS media query breakpoint changes. That's what matchMedia
is for, but that isn't as supported as media queries are and requires you to maintain those breakpoints is both CSS and JS.
People have been inventing solutions for this for a while. Even right here on CSS-Tricks, like Enquire.js, an animations based technique that avoids resize events, and even utilizing Sass.
Mike Herchel's solution is to change the :before
…
Importing CSS Breakpoints Into JavaScript is a post from CSS-Tricks
Original Link: https://www.lullabot.com/blog/article/importing-css-breakpoints-javascript
Share this article:
Tweet
View Full Article