Skip to content

Instantly share code, notes, and snippets.

@astanush
Created June 4, 2013 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astanush/5709816 to your computer and use it in GitHub Desktop.
Save astanush/5709816 to your computer and use it in GitHub Desktop.
Sass mixins
// Clearfix
@mixin clearfix {
*zoom: 1;
&:before,
&:after {
display: table;
content: "";
}
&:after {
clear: both;
}
}
// EM calculator: http://viljamis.com/blog/2013/prototyping-responsive-typography
// Converts pixels to EMs
// Example: font-size: em(16) --> font-size: 1em
$browser-context: 16; // Default
@function em($pixels, $context: $browser-context) {
@return #{$pixels/$context}em
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment