SassError 90var--num is not a number ╷81 │ for $val from 1 to $num
This error is caused by attempting to use a CSS variable as a numerical value in a Sass loop.
To fix the error, you need to make sure that the variable --num is defined as a number before using it in the loop. You can do this by either setting it explicitly as a number in your CSS, or by converting it to a number in your Sass code using the to-number() function.
For example, if you want --num to be the number 10, you can define it in your CSS like this:
:root {
--num: 10;
}
Or, if --num is defined as a string in your CSS, you can convert it to a number in your Sass code like this:
$num: to-number(var(--num));
This will ensure that $num is treated as a number in your loop and prevent the SassError: 90var(--num) is not a number error from occurring.
原文地址: https://www.cveoy.top/t/topic/bh9s 著作权归作者所有。请勿转载和采集!