| 1 |
// Remove last element gutter |
| 2 |
=omega-type($query: block, $direction: default) |
| 3 |
$table: if(belongs-to(table, $query), true, false) |
| 4 |
$auto: if(belongs-to(auto, $query), true, false) |
| 5 |
@if $direction != default |
| 6 |
@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." |
| 7 |
@else |
| 8 |
$direction: get-direction($layout-direction, $default-layout-direction) |
| 9 |
@if length($query) == 1 |
| 10 |
@if $auto |
| 11 |
&:last-child |
| 12 |
margin-#{$direction}: 0 |
| 13 |
@else if contains-display-value($query) |
| 14 |
@if $table |
| 15 |
padding-#{$direction}: 0 |
| 16 |
@else |
| 17 |
margin-#{$direction}: 0 |
| 18 |
@else |
| 19 |
+nth-of-type($query, $direction) |
| 20 |
@else if length($query) == 2 |
| 21 |
@if $table |
| 22 |
@if $auto |
| 23 |
&:last-child |
| 24 |
padding-#{$direction}: 0 |
| 25 |
@else |
| 26 |
&:nth-of-type(#{nth($query, 1)}) |
| 27 |
padding-#{$direction}: 0 |
| 28 |
@else |
| 29 |
@if $auto |
| 30 |
&:last-child |
| 31 |
margin-#{$direction}: 0 |
| 32 |
@else |
| 33 |
+nth-of-type(nth($query, 1), $direction) |
| 34 |
@else |
| 35 |
@warn "Too many arguments passed to the omega() mixin." |
| 36 |
|
| 37 |
=nth-of-type($query, $direction) |
| 38 |
$opposite-direction: get-opposite-direction($direction) |
| 39 |
&:nth-of-type(#{$query}) |
| 40 |
margin-#{$direction}: 0 |
| 41 |
@if type-of($query) == number |
| 42 |
&:nth-of-type(#{$query}+1) |
| 43 |
clear: $opposite-direction |