SCSS error

Does anyone know why do I get this error? https://codepen.io/myntsu/pen/BaqdKOw
3 Replies
Chris Bolson
Chris Bolson2y ago
Try this : @for $i from 0 through ($spheres - 1) { That gets rid of the error and shows the circles.I haven’t looked through all the code so I might be missing something. I will add that you don’t actually need to have $spheres - 1. If you want 23 spheres you could just set the vale of $spheres to 23 and save having to subtract 1 from it. That is of course unless you are using this variable somewhere else in your sass file and it needs to be 24…
Myndi
MyndiOP2y ago
Thank you thumbsUP
Zoë
Zoë2y ago
You want to use #{} for things where you want it to be interpreted literally and used for interpolation, not as a number nor a string https://sass-lang.com/documentation/interpolation
$classname: red;

body {
.box-#{$classname} {
background: $classname;
}
}
$classname: red;

body {
.box-#{$classname} {
background: $classname;
}
}
Numbers use it for giving values units
$size: 100px;
$multiplier: 4;

div {
width: $size; //width: 100px;
height: #{$multiplier * 100}px; //height: 400px;
}
$size: 100px;
$multiplier: 4;

div {
width: $size; //width: 100px;
height: #{$multiplier * 100}px; //height: 400px;
}
Want results from more Discord servers?
Add your server