app/assets/stylesheets/functions/_private.scss in neat-1.7.0.pre vs app/assets/stylesheets/functions/_private.scss in neat-1.7.0.rc

- old
+ new

@@ -1,15 +1,19 @@ // Checks if a number is even @function is-even($int) { @return $int % 2 == 0 } -// Checks if an element belongs to a list +// Checks if an element belongs to a list or not @function belongs-to($tested-item, $list) { - @return index($list, $tested-item) != false; + @return not not-belongs-to($tested-item, $list); } +@function not-belongs-to($tested-item, $list) { + @return not index($list, $tested-item); +} + // Contains display value @function contains-display-value($query) { @return belongs-to(table, $query) or belongs-to(block, $query) or belongs-to(inline-block, $query) @@ -19,38 +23,30 @@ // Parses the first argument of span-columns() @function container-span($span: $span) { @if length($span) == 3 { $container-columns: nth($span, 3); @return $container-columns; - } - - @else if length($span) == 2 { + } @else if length($span) == 2 { $container-columns: nth($span, 2); @return $container-columns; } - @else { - @return $grid-columns; - } + @return $grid-columns; } @function container-shift($shift: $shift) { $parent-columns: $grid-columns !global !default; @if length($shift) == 3 { $container-columns: nth($shift, 3); @return $container-columns; - } - - @else if length($shift) == 2 { + } @else if length($shift) == 2 { $container-columns: nth($shift, 2); @return $container-columns; } - @else { - @return $parent-columns; - } + @return $parent-columns; } // Generates a striped background @function gradient-stops($grid-columns, $color: $visual-grid-color) { $transparent: rgba(0,0,0,0); @@ -64,13 +60,11 @@ @for $i from 1 to $grid-columns*2 { @if is-even($i) { $values: append($values, $transparent $column-offset, comma); $values: append($values, $color $column-offset, comma); $column-offset: $column-offset + $column-width; - } - - @else { + } @else { $values: append($values, $color $column-offset, comma); $values: append($values, $transparent $column-offset, comma); $column-offset: $column-offset + $gutter-width; } } @@ -78,25 +72,25 @@ @return $values; } // Layout direction @function get-direction($layout, $default) { - $direction: nil; + $direction: null; - @if $layout == LTR or $layout == RTL { + @if to-upper-case($layout) == "LTR" or to-upper-case($layout) == "RTL" { $direction: direction-from-layout($layout); } @else { $direction: direction-from-layout($default); } @return $direction; } @function direction-from-layout($layout) { - $direction: nil; + $direction: null; - @if $layout == LTR { + @if to-upper-case($layout) == "LTR" { $direction: right; } @else { $direction: left; } @@ -104,10 +98,10 @@ } @function get-opposite-direction($direction) { $opposite-direction: left; - @if $direction == left { + @if $direction == "left" { $opposite-direction: right; } @return $opposite-direction; }