Skip to content

Instantly share code, notes, and snippets.

@zuDevonRW
Created January 27, 2017 20:46
Show Gist options
  • Save zuDevonRW/fa2c67a22b403aa3b42b7216fb02db82 to your computer and use it in GitHub Desktop.
Save zuDevonRW/fa2c67a22b403aa3b42b7216fb02db82 to your computer and use it in GitHub Desktop.
pe-calc mixin
@mixin pe-calc($property, $formula, $fallback) {
#{$property}: $fallback;
#{$property}: calc(#{$formula});
}
// usage
@include pe-calc(width, '100% - 100px - 18px', 70%);
// generates
width: 70%;
width: calc(100% - 100px - 18px);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment