Skip to content

Instantly share code, notes, and snippets.

@craigmdennis
Last active August 29, 2015 14:10
Show Gist options
  • Save craigmdennis/c093774d67e3ad6341d2 to your computer and use it in GitHub Desktop.
Save craigmdennis/c093774d67e3ad6341d2 to your computer and use it in GitHub Desktop.
Toolkit: Common @Mixins and helpers commonly used in projects
%clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
// ===================================================
// Positional Mixins
// ===================================================
@mixin fixed($top:0, $right:0, $bottom:0, $left:0) {
position: fixed;
top: $top;
right: $right;
bottom: $bottom;
left: $left;
}
// ===================================================
// Utilities
// ===================================================
@function rem($size) {
$font-base: 16px !default;
@if ($old-ie == true) {
@return $size *1px;
}
@else {
@return ($size / $font-base) * 1rem;
}
}
// For IE fallback, create an ie specific stylesheet
// and include the following:
//
// $old-ie: true;
// @import "styles";
//
// Where 'styles' is your main scss stylesheet name
// Include both stylesheets using conditional comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment