Merged omega and nth-omega #34

Closed
wants to merge 3 commits into
from
Jump to file or symbol
Failed to load files and symbols.
+15 −18
Diff settings

Always

Just for now

@@ -89,28 +89,25 @@ $fg-max-width: $max-width;
}
// Remove element gutter
-@mixin omega($display: block, $direction: right) {
- @if $display == table {
- padding-#{$direction}: 0;
- }
-
- @else {
- margin-#{$direction}: 0;
+@mixin omega($display_or_nth: block, $direction_or_display: right, $direction: right) {

This comment has been minimized.

Show comment Hide comment
@kaishin

kaishin Dec 29, 2012

That's an interesting solution, however I'm not sure about using one argument for two different things. In cases such as this one, I tend to favor the flexibility of list arguments.

@kaishin

kaishin Dec 29, 2012

That's an interesting solution, however I'm not sure about using one argument for two different things. In cases such as this one, I tend to favor the flexibility of list arguments.

+ @if $display_or_nth == table {
+ padding-#{$direction_or_display}: 0;
+ } @else if $display_or_nth == block {
+ margin-#{$direction_or_display}: 0;
+ } @else {
+ &:nth-child(#{$display_or_nth}) {
+ @if $direction_or_display == table {
+ padding-#{$direction}: 0;
+ } @else {
+ margin-#{$direction}: 0;
+ }
+ }
}
}
@mixin nth-omega($nth, $display: block, $direction: right) {
- @if $display == table {
- &:nth-child(#{$nth}) {
- padding-#{$direction}: 0;
- }
- }
-
- @else {
- &:nth-child(#{$nth}) {
- margin-#{$direction}: 0;
- }
- }
+ @warn "The nth-omega() mixin was deprecated. Please use omega()";
+ @include omega($nth, $display, $direction);
}
// Fill 100% of parent