Skip to content

Instantly share code, notes, and snippets.

@iilei
Created January 13, 2014 14:09
Show Gist options
  • Save iilei/8400882 to your computer and use it in GitHub Desktop.
Save iilei/8400882 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
/**
* In order to have common ways to deal with webmailer-specific overrides, those
* "failsafe" mixins shall provide shorthands therfor.
*/
$orientations: 'top', 'right', 'bottom', 'left';
@mixin padding($values...) {
padding: $values;
// 2 arguments
// arg1: top & bottom, arg2 right & left
@if (length($values)==1) {
$values: join($values, nth($values, 1));
}
@if (length($values)==2) {
$values: join($values, $values);
}
@if (length($values)==3) {
$values: join($values, nth($values, 2));
}
@if $SuperSpecific {
@for $i from 1 through length($values) {
padding-#{nth($orientations, $i)}: #{nth($values, $i)};
}
}
}
@mixin margin($values...) {
margin: $values;
// 2 arguments
// arg1: top & bottom, arg2 right & left
@if (length($values)==1) {
$values: join($values, nth($values, 1));
}
@if (length($values)==2) {
$values: join($values, $values);
}
@if (length($values)==3) {
$values: join($values, nth($values, 2));
}
@if $SuperSpecific {
@for $i from 1 through length($values) {
margin-#{nth($orientations, $i)}: #{nth($values, $i)};
}
}
}
/**
* In order to have common ways to deal with webmailer-specific overrides, those
* "failsafe" mixins shall provide shorthands therfor.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment