Created
March 24, 2016 15:17
-
-
Save tanmancan/ba6e97c5a06831555387 to your computer and use it in GitHub Desktop.
Collapse mixin
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
.column-left-no-important { | |
padding-left: 0 ; } | |
.column-left-important { | |
padding-left: 0 !important; } | |
.column-no-important { | |
padding-left: 0 ; | |
padding-right: 0 ; } | |
.column-important { | |
padding-left: 0 !important; | |
padding-right: 0 !important; } |
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
@mixin collapse($side, $important: false) { | |
@if $important { | |
$flag: "!important"; | |
} | |
@else { | |
$flag: ""; | |
} | |
@if $side==both { | |
padding-left: 0 #{$flag}; | |
padding-right: 0 #{$flag}; | |
} | |
@else { | |
padding-#{$side}: 0 #{$flag}; | |
} | |
} | |
.column-left-no-important { | |
@include collapse(left); | |
} | |
.column-left-important { | |
@include collapse(left, true); | |
} | |
.column-no-important { | |
@include collapse(both); | |
} | |
.column-important { | |
@include collapse(both, true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment