Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alana314/54ae97fd72a9d97d230190fefe518e0a to your computer and use it in GitHub Desktop.
Save alana314/54ae97fd72a9d97d230190fefe518e0a to your computer and use it in GitHub Desktop.
//Calculates current em size in pixels, tests current Foundation 5 media query size and logs it in the console
//Create a new bookmark and paste this as the URL:
javascript: var width = document.body.clientWidth;var em = parseFloat(getComputedStyle(document.body).getPropertyValue('font-size'));if (width < 40 * em) { console.log('small', width);} else if (width < 64 * em) { console.log('medium', width);} else if (width < 90 * em) { console.log('large', width);} else if (width < 120 * em) { console.log('xlarge', width);} else { console.log('xxlarge', width);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment