-
Notifications
You must be signed in to change notification settings - Fork 464
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
Interpolation mangles up lists #639
Comments
This is not to do with For your use-case, you could in the meantime use a loop to build the right string for you, e.g. $color-names: map-keys($primary-color-palette);
$length: length($color-names);
$string: '';
@for $n from 1 through $length {
$name: nth($color-names, $n);
$string: $string + if($n == $length, '#{$name}', '#{$name}, ');
}
.out {
content: $string;
} |
@lunelson Thanks you for the workaround. I updated the issue's title, but I think the example still holds. If you have an suggestion on how to better demonstrate the issue, I will adapt it |
A simplified test case FTR foo {
foo: #{"foo", "bar", "baz"};
} |
As of today, I'm still seeing problems with lists of quoted items. The following is a bit elaborate but please bear with me, it's just to show that what's at issue is a list of explicitly quoted strings: $contexts: (
mobile-l: (min-width: 20em),
tablet-s: (min-width: 30em),
tablet-l: (min-width: 48em),
desktop-s: (min-width: 64em),
desktop-m: (min-width: 80em)
) !default;
$quoted-context-keys: ();
@each $key in map-keys($contexts) {
$quoted-context-keys: append($quoted-context-keys, quote($key), 'comma');
}
.test {
output: map-keys($contexts);
output: $quoted-context-keys;
output: #{$quoted-context-keys};
output: "[#{$quoted-context-keys}]";
output: "#{$quoted-context-keys}";
output: "["#{$quoted-context-keys}"]";
output: '#{$quoted-context-keys}';
output: "['#{$quoted-context-keys}']";
} in ruby sass 3.4.9 produces .test {
output: mobile-l, tablet-s, tablet-l, desktop-s, desktop-m;
output: "mobile-l", "tablet-s", "tablet-l", "desktop-s", "desktop-m";
output: mobile-l, tablet-s, tablet-l, desktop-s, desktop-m;
output: "[mobile-l, tablet-s, tablet-l, desktop-s, desktop-m]";
output: "mobile-l, tablet-s, tablet-l, desktop-s, desktop-m";
output: "["mobile-l, tablet-s, tablet-l, desktop-s, desktop-m"]";
output: "mobile-l, tablet-s, tablet-l, desktop-s, desktop-m";
output: "['mobile-l, tablet-s, tablet-l, desktop-s, desktop-m']"; } but in sassc: 3.1.0-2-g2033 / libsass: 3.1.0-76-g71448, produces .test {
output: mobile-l, tablet-s, tablet-l, desktop-s, desktop-m;
output: "mobile-l", "tablet-s", "tablet-l", "desktop-s", "desktop-m";
output: mobile-l", "tablet-s", "tablet-l", "desktop-s", "desktop-m;
output: "[mobile-l", "tablet-s", "tablet-l", "desktop-s", "desktop-m]";
output: "mobile-l", "tablet-s", "tablet-l", "desktop-s", "desktop-m";
output: "["mobile-l", "tablet-s", "tablet-l", "desktop-s", "desktop-m"]";
output: 'mobile-l", "tablet-s", "tablet-l", "desktop-s", "desktop-m';
output: "['mobile-l", "tablet-s", "tablet-l", "desktop-s", "desktop-m']"; } note different results with single and double quoting, etc. |
Thanks for this @lunelson . This appears to be a different issue than the one originally reported. Could you please create a new issue and spec? |
Sure thing |
This should be solved by #910! |
I had a strange bug, and tracked it down to LibSass.
map-keys($primary-color-palette)
result:'50', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'A100', 'A200', 'A400', 'A700'
"#{map-values($primary-color-palette)}"
result:"5','10','20','30','40','50','60','70','80','90','A10','A20','A40','A700"
see it in Sassmeister
The text was updated successfully, but these errors were encountered: