Skip to content

Instantly share code, notes, and snippets.

@Tonours
Created February 20, 2014 11:04
Show Gist options
  • Save Tonours/9111271 to your computer and use it in GitHub Desktop.
Save Tonours/9111271 to your computer and use it in GitHub Desktop.
// ==========================================================================
// Helpers
// ==========================================================================
// Switch ON/OFF
// ==========================================================================
$reset-margin: true;
$margin: true;
$reset-padding: true;
$padding: true;
$float: true;
$alignement: true;
// Margin
// ==========================================================================
$orientations: top, right, bottom, left;
$dimensions: 5, 10, 15, 20, 60;
@if $reset-margin == true {
@each $orientation in $orientations {
.reset-margin-#{$orientation}{
margin-#{$orientation}: 0;
}
}
}
@if $margin == true {
@each $orientation in $orientations {
@each $dimension in $dimensions {
.margin-#{$orientation}-#{$dimension} {
margin-#{$orientation}: #{$dimension}px;
}
}
}
}
// Padding
// ==========================================================================
@if $reset-padding == true {
@each $orientation in $orientations {
.reset-padding-#{$orientation}{
padding-#{$orientation}: 0;
}
}
}
@if $padding == true {
@each $orientation in $orientations {
@each $dimension in $dimensions {
.padding-#{$orientation}-#{$dimension} {
padding-#{$orientation}: #{$dimension}px;
}
}
}
}
// Alignements
// ==========================================================================
// Floated alignments
$floateds: left, right, none;
@if $float == true {
@each $floated in $floateds {
.float-#{$floated} {
float: $floated;
}
}
}
// Text alignements
$aligns: left, right, center;
@if $alignement == true {
@each $align in $aligns {
.text-#{$align} {
text-align: $aligns;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment