Skip to content

Cannot use nested lists #160

@gabrielfin

Description

@gabrielfin

Defining a nested list (a list of lists) creates a list with all the sublists merged (always, except when the inner list is separated by spaces and the outer one by commas)

For example:

$a: 1, 2, 3;
$b: 4, 5, 6;
$x: $a, $b;
foo {
    bar: nth($x, 1);
    baz: nth($x, 2);
}

should output

foo {
  bar: 1, 2, 3;
  baz: 4, 5, 6;
}

instead, the output is

foo {
  bar: 1;
  baz: 2;
}

The same happens when appending lists, and even when defining the nested list as
(1, 2, 3), (4, 5, 6)

I believe the problem is in SassLiteral::op_comma which returns a SassString, but should actually return a SassList. I tried changing it but that triggers other issues and I get stuck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions