Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append function doesn't appear to append correctly inside loops #1796

Closed
cimmanon opened this issue Dec 19, 2015 · 2 comments
Closed

Append function doesn't appear to append correctly inside loops #1796

cimmanon opened this issue Dec 19, 2015 · 2 comments

Comments

@cimmanon
Copy link

Tested against Sassmeister (running 3.3.2) and 3.3.1-52-gf89e

.parent {
    .brother, .sister, .cousin {
        color: green;
        sel: &;

        $new-sel: ();
        @each $s in & {
            $last: nth($s, -1);
            $new-sel: append($new-sel, $s #{'+'} $last, comma);
            x: $new-sel;
        }
        @at-root #{$new-sel} {
            debug: foo;
        }
    }
}

Ruby Sass Output:

.parent .brother, .parent .sister, .parent .cousin {
  color: green;
  x: .parent .brother + .brother;
  x: .parent .brother + .brother, .parent .sister + .sister;
  x: .parent .brother + .brother, .parent .sister + .sister, .parent .cousin + .cousin;
}
.parent .brother + .brother, .parent .sister + .sister, .parent .cousin + .cousin {
  debug: foo;
}

LibSass Output:

.parent .brother, .parent .sister, .parent .cousin {
  color: green;
  x: .parent .brother, .parent .sister, .parent .cousin + .parent .cousin;
}

.parent .brother, .parent .sister, .parent .cousin + .parent .cousin {
  debug: foo;
}

Note how LibSass doesn't show the intermediate values inside the loop (property x) and only the very last element in the list contains our adjacent sibling selector.

@xzyfer
Copy link
Contributor

xzyfer commented Dec 27, 2015

Thanks for the report @cimmanon. I can confirm this issue exists on master.

We're in need of a more specific test case.

@xzyfer xzyfer added this to the 3.4 milestone Dec 27, 2015
mgreter added a commit to mgreter/sass-spec that referenced this issue Jan 17, 2016
@mgreter mgreter modified the milestones: 3.3.3, 3.4 Jan 17, 2016
@mgreter mgreter self-assigned this Jan 17, 2016
@mgreter
Copy link
Contributor

mgreter commented Jan 17, 2016

Fixed with #1757

@mgreter mgreter closed this as completed Jan 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants