Created
May 30, 2016 23:51
-
-
Save jeffarese/ce64dac07af304d91688394a9cbce00a to your computer and use it in GitHub Desktop.
Sass Calc mixin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description | |
* Generates the calc values for cross browser compatibility | |
* | |
* @author Jeffarese | |
* | |
* @param $property | |
* @param $expression | |
* @returns | |
* <$property>: -moz-calc(<value>); | |
* <$property>: -webkit-calc(<value>); | |
* <$property>: calc(<value>); | |
* | |
* @example | |
* .selector { | |
* @include calc(width, '100% - 105px'); | |
* } | |
*/ | |
@mixin calc($property, $expression) { | |
#{$property}: -moz-calc(#{$expression}); | |
#{$property}: -webkit-calc(#{$expression}); | |
#{$property}: calc(#{$expression}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment