A Pen by Secret Sam on CodePen.
Created
February 3, 2014 23:35
-
-
Save alettieri/8794662 to your computer and use it in GitHub Desktop.
A Pen by Captain Anonymous.
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
<head> | |
<meta class='my-small-query' /> | |
<meta class='my-medium-query' /> | |
</head> | |
<div> | |
</div> |
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
$(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 ); | |
}); |
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
@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