Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
June 15, 2015 03:28 pm GMT

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:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks