Skip to content

Instantly share code, notes, and snippets.

@aslamdoctor
Created March 26, 2020 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aslamdoctor/2d058468f848ba8ce017cb49da457130 to your computer and use it in GitHub Desktop.
Save aslamdoctor/2d058468f848ba8ce017cb49da457130 to your computer and use it in GitHub Desktop.
Sass Margin / Padding Helper
// Variables
$spacing-top:160px;
$spacing-bottom:160px;
// Mixins
@mixin paddings($top:$spacing-top, $bottom:$spacing-bottom){
padding-top:$top;
padding-bottom:$bottom;
}
@mixin margins($top:$spacing-top, $bottom:$spacing-bottom){
margin-top:$top;
margin-bottom:$bottom;
}
// Usage
@include paddings();
@include margins();
@include paddings($top:20px);
@include margins($bottom:20px);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment