Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.