Is there a way to use random function into a selector in sass? something like this
span {
&:nth-child(random(10)) {
opacity: 1;
}
}
Is there a way to use random function into a selector in sass? something like this
span {
&:nth-child(random(10)) {
opacity: 1;
}
}
Try out this code:
span {
&:nth-child(#{random(10)}) {
opacity: 1;
}
}
Here's the result:
You can read more about interpolation from this article.