I was just troubleshooting this and your post was basically the only one I found. I was using a @mixin
that scales font sizes for screen sizes and kept getting an error in my @mixin
when the input variable for the list in @each
loop didnt have a comma in it.
Doensn't work:
$text_sizes: 'html' 17px;
Works:
$text_sizes: 'html' 17px,;
Mixin:
@adjust_screens: 1280px 0.9, ...;
@mixin fontsizer ( $tag_and_base,$screens ) {
@each $tag, $base in $tag_and_base {
// got an error here: "expected selector."
#{$tag} {
font-size: calc( #{$base_size} * 1 );
}
@each $x, $y in $screens {
...repeats font size calculation for sizes
}
}
}
@include fontsizer( $text_sizes, $adjust_screens );
Not sure if this is how it's supposed to work or if this will work in every compiler, but it does work in sass-lang.com playground (https://sass-lang.com/playground/)