Skip to content

Instantly share code, notes, and snippets.

@bangpound
Created January 21, 2011 00:56
Show Gist options
  • Save bangpound/789061 to your computer and use it in GitHub Desktop.
Save bangpound/789061 to your computer and use it in GitHub Desktop.
Bidirectional Susy grid mixins.
// use with https://github.com/bangpound/compass-susy-plugin/blob/feature%2Frtl/sass/susy/_grid.scss
// html element must have a dir attribute to indicate reading direction.
// e.g. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ar" lang="ar" dir="rtl">
@mixin bidi-columns($n, $context: false) {
[dir="ltr"] & {
@include columns($n, $context, left);
}
[dir="rtl"] & {
@include columns($n, $context, right);
}
}
@mixin bidi-alpha($nested: false) {
[dir="ltr"] & {
@include alpha($nested, left);
}
[dir="rtl"] & {
@include alpha($nested, right);
}
}
@mixin bidi-omega($nested: false) {
[dir="ltr"] & {
@include omega($nested, left);
}
[dir="rtl"] & {
@include omega($nested, right);
}
}
@chriseppstein
Copy link

Sorry, didn't mean to sound so negative.

@cbfrance
Copy link

yeah, I did it ie6-style with class attributes like dis: https://gist.github.com/789120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment