Last active
December 17, 2015 12:49
-
-
Save zesda/5612517 to your computer and use it in GitHub Desktop.
Dynamically fetches the media query stylesheet breakpoints from the DOM. Currently no support for multiple media ranges, i.e. media = "screen and (min-width:X) and (max-width:Y)"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arr = new Array(); | |
$('link[media]').each(function(i){ | |
typeof($(this).attr('media').split('(')[1]) !== 'undefined' | |
? arr.push(new Array($(this).attr('media').split('(')[1].split(':')[0], $(this).attr('media').split('(')[1].split(':')[1].split('px')[0])) | |
: null ; | |
}); | |
console.log(arr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment