Last active
August 6, 2018 15:07
-
-
Save evertonthepaula/cf7a1d4913b90dc31fe100a5f54b69ed to your computer and use it in GitHub Desktop.
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
$distanceBase = 8px; | |
//Padding mixin | |
@mixin padding($top:null, $right:null, $bottom:null, $left:null) | |
{ | |
padding: calcDistance($top) calcDistance($right) calcDistance($bottom) calcDistance($left); | |
} | |
//Margin mixin | |
@mixin margin($top:null, $right:null, $bottom:null, $left:null) | |
{ | |
margin: calcDistance($top) calcDistance($right) calcDistance($bottom) calcDistance($left); | |
} | |
@function calcDistance($distance) | |
{ | |
@if $distance == null or $distance == 0 { | |
@return $distance; | |
} | |
@return $distance*$distanceBase; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment