Skip to content

Instantly share code, notes, and snippets.

@benfrain benfrain/mq-js.js
Created Jun 11, 2015

Embed
What would you like to do?
Linking JS and CSS for media queries
// @media all and (min-width: 45em) {
// body:after {
// content: 'Splus';
// display: none;
// }
// }
var size = window.getComputedStyle(document.body,':after').getPropertyValue('content');
if (size.indexOf("Splus") !=-1) {
// Do stuff.
}
@benfrain

This comment has been minimized.

Copy link
Owner Author

benfrain commented Jun 11, 2015

Amended from: http://adactio.com/journal/5429/
Use this all the time to link CSS/JS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.