Skip to content

Instantly share code, notes, and snippets.

@anasnakawa
Created April 1, 2015 14:27
Show Gist options
  • Save anasnakawa/8711ff25a2cf5e0a2ffd to your computer and use it in GitHub Desktop.
Save anasnakawa/8711ff25a2cf5e0a2ffd to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
// rtl variables
$bi-app-left : right;
$bi-app-right : left;
$bi-app-direction : rtl;
$bi-app-invert-direction: ltr;
@mixin bi-app-compact($property, $top, $right, $bottom, $left, $imp: false) {
@if $imp == true {
@if $bi-app-direction == ltr {
#{$property}: $top $right $bottom $left !important;
} @else {
#{$property}: $top $left $bottom $right !important;
}
} @else {
@if $bi-app-direction == ltr {
#{$property}: $top $right $bottom $left;
} @else {
#{$property}: $top $left $bottom $right;
}
}
}
@mixin padding-left($distance, $imp: false) {
@if $imp == true {
padding-#{$bi-app-left}: $distance !important;
} @else {
padding-#{$bi-app-left}: $distance;
}
}
@mixin padding-right($distance, $imp: false) {
@if $imp == true {
padding-#{$bi-app-right}: $distance !important;
} @else {
padding-#{$bi-app-right}: $distance;
}
}
@mixin margin($top, $right, $bottom, $left, $imp: false) {
@include bi-app-compact(margin, $top, $right, $bottom, $left, $imp);
}
body {
// backward compitable
@include padding-right( 10px );
@include margin( 10px, 20px, 30px, 40px);
// new important feature
@include margin( 10px, 20px, 30px, 40px, true);
@include padding-left( 10px, true );
}
body {
padding-left: 10px;
margin: 10px 40px 30px 20px;
margin: 10px 40px 30px 20px !important;
padding-right: 10px !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment