stylesheets/neat/grid/_omega.scss in neat-compass-1.2.1 vs stylesheets/neat/grid/_omega.scss in neat-compass-1.3.0
- old
+ new
@@ -1,10 +1,16 @@
// Remove last element gutter
-@mixin omega($query: block, $direction: right) {
+@mixin omega($query: block, $direction: default) {
$table: if(belongs-to(table, $query), true, false);
$auto: if(belongs-to(auto, $query), true, false);
+ @if $direction != default {
+ @warn "The omega mixin will no longer take a $direction argument. To change the layout direction, use row($direction) or set $default-layout-direction instead."
+ } @else {
+ $direction: get-direction($layout-direction, $default-layout-direction);
+ }
+
@if length($query) == 1 {
@if $auto {
&:last-child {
margin-#{$direction}: 0;
}
@@ -19,13 +25,11 @@
margin-#{$direction}: 0;
}
}
@else {
- &:nth-child(#{$query}) {
- margin-#{$direction}: 0;
- }
+ @include nth-child($query, $direction);
}
}
@else if length($query) == 2 {
@if $table {
@@ -48,21 +52,28 @@
margin-#{$direction}: 0;
}
}
@else {
- &:nth-child(#{nth($query, 1)}) {
- margin-#{$direction}: 0;
- }
+ @include nth-child(nth($query, 1), $direction);
}
}
}
@else {
@warn "Too many arguments passed to the omega() mixin."
}
}
-@mixin nth-omega($nth, $display: block, $direction: right) {
- @warn "The nth-omega() mixin is deprecated. Please use omega() instead.";
- @include omega($nth $display, $direction);
+@mixin nth-child($query, $direction) {
+ $opposite-direction: get-opposite-direction($direction);
+
+ &:nth-child(#{$query}) {
+ margin-#{$direction}: 0;
+ }
+
+ @if type-of($query) == number {
+ &:nth-child(#{$query}+1) {
+ clear: $opposite-direction;
+ }
+ }
}