Skip to content

Instantly share code, notes, and snippets.

@alettieri
Created February 3, 2014 23:35
Show Gist options
  • Save alettieri/8794662 to your computer and use it in GitHub Desktop.
Save alettieri/8794662 to your computer and use it in GitHub Desktop.
A Pen by Captain Anonymous.
<head>
<meta class='my-small-query' />
<meta class='my-medium-query' />
</head>
<div>
</div>
$(document).ready(function(){
var queries = {
small: $('.my-small-query').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
medium: $('.my-medium-query').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, '')
};
console.log( queries );
});
@import "compass";
$sm-query: "only screen and (max-width: 40em)";
$med-query: "only screen and (min-width:40.063em)";
meta {
&.my-small-query {
font-family: "/" + unquote( $sm-query ) + "/";
}
&.my-medium-query {
font-family: "/" + unquote( $med-query ) + "/";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment