Skip to content

Instantly share code, notes, and snippets.

@tBaxter
Last active December 17, 2015 05:18
Show Gist options
  • Save tBaxter/5556564 to your computer and use it in GitHub Desktop.
Save tBaxter/5556564 to your computer and use it in GitHub Desktop.
Connecting SASS @content named media queries to JS.
body {
&:after { display: none; }
@include breakpoint(s) { &:after { content: 'small'; } };
@include breakpoint(m) { &:after { content: 'medium'; } };
@include breakpoint(l) { &:after { content: 'large'; } };
}
var screenSize = window.getComputedStyle(document.body,':after').getPropertyValue('content');
Inspired by http://adactio.com/journal/5429/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment