Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Preserve backwards compatibility of triangle mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil LaPier committed Mar 27, 2014
1 parent b15dc93 commit 089beb5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/assets/stylesheets/addons/_triangle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
$height: nth($size, length($size));

$foreground-color: nth($color, 1);
$background-color: transparent !default;
@if (length($color) == 2) {
$background-color: nth($color, 2);
}
$background-color: if(length($color) == 2, nth($color, 2), transparent);

This comment has been minimized.

Copy link
@kenips

kenips Apr 21, 2014

@plapier I'm getting List index is 2 but list is only 1 item long for 'nth'.... maybe it should be @if?

This comment has been minimized.

Copy link
@kenips

kenips Apr 21, 2014

Oh I see what the issue is - in sass 3.2 all arguments are evaluated and hence I get the above error. Fixed in 3.3.

This comment has been minimized.

Copy link
@kennethormandy

kennethormandy Apr 21, 2014

Contributor

I think the following works, it would need to be switched for $height, too. I’m guessing libsass doesn’t support this shorthand.

@if (length($color) == 2) {
    $background-color: nth($color, 2);
} @else {
    $background-color: transparent;
}

This comment has been minimized.

Copy link
@kenips

kenips Apr 21, 2014

Yes @if still works (or reverting the above change would work too). Just opened an issue: #405


@if ($direction == up) or ($direction == down) or ($direction == right) or ($direction == left) {

$width: $width / 2;
$height: if(length($size) > 1, $height, $height/2);

@if $direction == up {
border-left: $width solid $background-color;
Expand Down

0 comments on commit 089beb5

Please sign in to comment.