Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sass mixins
// Clearfix
@mixin clearfix {
*zoom: 1;
&:after {
display: table;
content: "";
&:after {
clear: both;
// EM calculator:
// 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.