Last active
August 29, 2015 14:05
-
-
Save mattradford/c04dcb12ddca2b7ca7ff to your computer and use it in GitHub Desktop.
LESS mixin to calculate a width
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
.calc-width(@margin, @fallback) { | |
width: @fallback; | |
width: -o-calc(~"100% - "@margin); | |
width: -webkit-calc(~"100% - "@margin); /** Safari 6, Chrome 19-25 **/ | |
width: -moz-calc(~"100% - "@margin); /** FF 4-15 **/ | |
width: calc(~"100% - "@margin); /** FF 16+, IE 9+, Opera 15, Chrome 26+, Safari 7 and future other browsers **/ | |
/* See http://caniuse.com/#search=calc for known issues with calc */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment