Created
April 22, 2014 14:21
-
-
Save krisbulman/11181086 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or 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
| <div class="example">Calc Test</div> |
This file contains hidden or 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
| // ---- | |
| // Sass (v3.2.19) | |
| // Compass (v0.12.6) | |
| // ---- | |
| // Calc | |
| // Provides fallback and vendor-specific prefixes for calc. | |
| // http://caniuse.com/calc | |
| // | |
| // $property - Ex: 'max-width'. | |
| // $expression - Expression to calculate the value from. Ex: '100% - 60px'. | |
| // $fallback - Expression for browsers without calc support. Ex: '80%'. | |
| @mixin calc($property, $expression, $fallback) { | |
| #{$property}: #{$fallback}; | |
| #{$property}: -webkit-calc(#{$expression}); | |
| #{$property}: calc(#{$expression}); | |
| } | |
| .example { | |
| @include calc(width, '50% - 100px', 200px); | |
| background: #ccc; | |
| } |
This file contains hidden or 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
| .example { | |
| width: 200px; | |
| width: -webkit-calc(50% - 100px); | |
| width: calc(50% - 100px); | |
| background: #ccc; | |
| } |
This file contains hidden or 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
| <div class="example">Calc Test</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment