Skip to content

Instantly share code, notes, and snippets.

@kianoshp
Created September 30, 2014 16:08
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 kianoshp/2bea7620ece9a932ee8f to your computer and use it in GitHub Desktop.
Save kianoshp/2bea7620ece9a932ee8f to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
/**************** padding and margin settings *****************
Setting padding and margins to be added to different sections
This sections contains individual setting and also a mixin
to be able to add to different sections
spacing helpers
p,m = padding,margin
a,t,r,b,l,v,h = all,top,right,bottom,left,vertical,horizontal
s,m,l,n = small(5px),medium(10px),large(20px),none(0px)
This scss will create an example of the following:
.pts, .pas, .pvs {
padding-top: 5px !important; }
.ptm, .pam, .pvm {
padding-top: 10px !important; }
.ptl, .pal, .pvl {
padding-top: 20px !important; }
**************************************************************/
$paddingMargins: p, m;
$positions: t, r, b, l;
$padding-increment: 5px;
$sizes: (s: 1, m: 2, l: 4, n: 0);
$pm: padding;
$pos: top;
$sz: 0;
$hvpos: v;
// Set the initial padding or margin
@each $paddingMargin in $paddingMargins {
$tempVar : $paddingMargin;
@if $paddingMargin == "p" {
$pm: padding;
} @else {
$pm: margin;
}
// set the position (top, right, bottom, left) and the hv position
@each $position in $positions {
$tempVar2: #{$tempVar}#{$position};
@if $position == "t" {
$pos: top;
$hvpos: v;
} @else if $position == "r" {
$pos: right;
$hvpos: h;
} @else if $position == "b" {
$pos: bottom;
$hvpos: v;
} @else if $position == "l" {
$pos: left;
$hvpos: h;
}
//set the size
@each $size, $increment in $sizes {
$tempVar3: #{$tempVar2}#{$size};
$sz: $padding-increment * $increment;
.#{$tempVar3}, .#{$tempVar}a#{$size}, .#{$paddingMargin}#{$hvpos}#{$size} {
#{$pm}-#{$pos}: $sz !important;
}
}
}
}
/***************** end padding and margin settings *************/
/**************** padding and margin settings *****************
Setting padding and margins to be added to different sections
This sections contains individual setting and also a mixin
to be able to add to different sections
spacing helpers
p,m = padding,margin
a,t,r,b,l,v,h = all,top,right,bottom,left,vertical,horizontal
s,m,l,n = small(5px),medium(10px),large(20px),none(0px)
This scss will create an example of the following:
.pts, .pas, .pvs {
padding-top: 5px !important; }
.ptm, .pam, .pvm {
padding-top: 10px !important; }
.ptl, .pal, .pvl {
padding-top: 20px !important; }
**************************************************************/
.pts, .pas, .pvs {
padding-top: 5px !important;
}
.ptm, .pam, .pvm {
padding-top: 10px !important;
}
.ptl, .pal, .pvl {
padding-top: 20px !important;
}
.ptn, .pan, .pvn {
padding-top: 0px !important;
}
.prs, .pas, .phs {
padding-right: 5px !important;
}
.prm, .pam, .phm {
padding-right: 10px !important;
}
.prl, .pal, .phl {
padding-right: 20px !important;
}
.prn, .pan, .phn {
padding-right: 0px !important;
}
.pbs, .pas, .pvs {
padding-bottom: 5px !important;
}
.pbm, .pam, .pvm {
padding-bottom: 10px !important;
}
.pbl, .pal, .pvl {
padding-bottom: 20px !important;
}
.pbn, .pan, .pvn {
padding-bottom: 0px !important;
}
.pls, .pas, .phs {
padding-left: 5px !important;
}
.plm, .pam, .phm {
padding-left: 10px !important;
}
.pll, .pal, .phl {
padding-left: 20px !important;
}
.pln, .pan, .phn {
padding-left: 0px !important;
}
.mts, .mas, .mvs {
margin-top: 5px !important;
}
.mtm, .mam, .mvm {
margin-top: 10px !important;
}
.mtl, .mal, .mvl {
margin-top: 20px !important;
}
.mtn, .man, .mvn {
margin-top: 0px !important;
}
.mrs, .mas, .mhs {
margin-right: 5px !important;
}
.mrm, .mam, .mhm {
margin-right: 10px !important;
}
.mrl, .mal, .mhl {
margin-right: 20px !important;
}
.mrn, .man, .mhn {
margin-right: 0px !important;
}
.mbs, .mas, .mvs {
margin-bottom: 5px !important;
}
.mbm, .mam, .mvm {
margin-bottom: 10px !important;
}
.mbl, .mal, .mvl {
margin-bottom: 20px !important;
}
.mbn, .man, .mvn {
margin-bottom: 0px !important;
}
.mls, .mas, .mhs {
margin-left: 5px !important;
}
.mlm, .mam, .mhm {
margin-left: 10px !important;
}
.mll, .mal, .mhl {
margin-left: 20px !important;
}
.mln, .man, .mhn {
margin-left: 0px !important;
}
/***************** end padding and margin settings *************/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment