Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
Adds not function for Libsass compatibility
Browse files Browse the repository at this point in the history
- Closes #254
  • Loading branch information
kennethormandy authored and Reda Lemeden committed Jan 2, 2015
1 parent 1a67b1a commit 53e7190
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/functions/_new-breakpoint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
$query: append($query, $total-columns);
}

@if not belongs-to($query, $visual-grid-breakpoints) {
@if is-not(belongs-to($query, $visual-grid-breakpoints)) {
$visual-grid-breakpoints: append($visual-grid-breakpoints, $query, comma) !global;
}

Expand Down
12 changes: 9 additions & 3 deletions app/assets/stylesheets/functions/_private.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
// Not function for Libsass compatibility
// https://github.com/sass/libsass/issues/368
@function is-not($value) {
@return if($value, false, true);
}

// Checks if a number is even
@function is-even($int) {
@return $int % 2 == 0
@return $int % 2 == 0;
}

// Checks if an element belongs to a list or not
@function belongs-to($tested-item, $list) {
@return not not-belongs-to($tested-item, $list);
@return is-not(not-belongs-to($tested-item, $list));
}

@function not-belongs-to($tested-item, $list) {
@return not index($list, $tested-item);
@return is-not(index($list, $tested-item));
}

// Contains display value
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/grid/_media.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
$default-grid-columns: $grid-columns;
$grid-columns: $total-columns !global;

@if not is-even(length($query)) {
@if is-not(is-even(length($query))) {
$grid-columns: nth($query, $loop-to) !global;
$loop-to: $loop-to - 1;
}
Expand Down

0 comments on commit 53e7190

Please sign in to comment.