list-separator
is comma for maps and arglists
This commit is contained in:
parent
a0786619de
commit
cb046f7be7
@ -70,6 +70,7 @@ pub(crate) fn list_separator(mut args: CallArgs, parser: &mut Parser<'_>) -> Sas
|
|||||||
Ok(Value::String(
|
Ok(Value::String(
|
||||||
match args.get_err(0, "list")? {
|
match args.get_err(0, "list")? {
|
||||||
Value::List(_, sep, ..) => sep.name(),
|
Value::List(_, sep, ..) => sep.name(),
|
||||||
|
Value::Map(..) | Value::ArgList(..) => ListSeparator::Comma.name(),
|
||||||
_ => ListSeparator::Space.name(),
|
_ => ListSeparator::Space.name(),
|
||||||
}
|
}
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
|
@ -61,6 +61,27 @@ test!(
|
|||||||
"a {\n color: list-separator(((a b, c d)));\n}\n",
|
"a {\n color: list-separator(((a b, c d)));\n}\n",
|
||||||
"a {\n color: comma;\n}\n"
|
"a {\n color: comma;\n}\n"
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
list_separator_map,
|
||||||
|
"a {\n color: list-separator((a: b, c: d));\n}\n",
|
||||||
|
"a {\n color: comma;\n}\n"
|
||||||
|
);
|
||||||
|
test!(
|
||||||
|
list_separator_arglist,
|
||||||
|
"@mixin foo($arg...) {
|
||||||
|
color: list-separator($arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
@include foo(1, 2, 3);
|
||||||
|
}",
|
||||||
|
"a {\n color: comma;\n}\n"
|
||||||
|
);
|
||||||
|
test!(
|
||||||
|
list_separator_empty,
|
||||||
|
"a {\n color: list-separator(());\n}\n",
|
||||||
|
"a {\n color: space;\n}\n"
|
||||||
|
);
|
||||||
test!(
|
test!(
|
||||||
set_nth_named_args,
|
set_nth_named_args,
|
||||||
"a {\n color: set-nth($list: 1 2 3, $n: 2, $value: foo);\n}\n",
|
"a {\n color: set-nth($list: 1 2 3, $n: 2, $value: foo);\n}\n",
|
||||||
@ -127,11 +148,6 @@ test!(
|
|||||||
"a {\n color: append((a, b), c, space);\n}\n",
|
"a {\n color: append((a, b), c, space);\n}\n",
|
||||||
"a {\n color: a b c;\n}\n"
|
"a {\n color: a b c;\n}\n"
|
||||||
);
|
);
|
||||||
test!(
|
|
||||||
list_separator_empty,
|
|
||||||
"a {\n color: list-separator(());\n}\n",
|
|
||||||
"a {\n color: space;\n}\n"
|
|
||||||
);
|
|
||||||
test!(
|
test!(
|
||||||
append_empty,
|
append_empty,
|
||||||
"a {\n color: append((), a);\n}\n",
|
"a {\n color: append((), a);\n}\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user