0
I am using a background made with svg from this link here but his color palette is SCSS
and I’m using the LESS
how can I convert these elements to LESS
? I tried to put the @
in place of $
but it didn’t work follow the code in SCSS
that I need to convert to LESS
SCSS:
$colors: (
#feda3e,
#cc6698,
#0869ad,
#ff8300,
#7A86b8,
#f05133,
#2aa9e0,
#71bf45,
#ef0e39,
#9e79d7,
);
$color: nth($colors, random(length($colors)));
#bg {
background: radial-gradient(ellipse at center, @color 0%, darken(@color.toHSL, 50%) 100%);
}
LESS:
@colors:
#feda3e,
#cc6698,
#0869ad,
#ff8300,
#7A86b8,
#f05133,
#2aa9e0,
#71bf45,
#ef0e39,
#9e79d7
;
@color: nth(@colors, random(length(@colors)));
#bg {
background: radial-gradient(ellipse at center, @color 0%, darken(@color, 50%) 100%);
}
Have you tested with CSS Variables? I think it didn’t work because this last line looks like a SASS Mixin and in LESS it should probably be otherwise.
– hugocsl
I kind of figured out the problem I’ll rephrase the question
– Felipe Henrique
the problem is in this sequence of code #bg { background: radial-gradient(Ellipse at center, @color 0%, Darken(@color 50%) 100%); }
– Felipe Henrique
Guy by Codepen seems that the Example is not SASS is SCSS has some differences... Check out an example https://futurestud.io/blog/content/images/2014/Jun/sass-vs-scss.png here you can read about https://answall.com/questions/54453/qual%C3%A9-a-diferen%C3%A7a-entre-Sass-e-scss
– hugocsl
understood I managed to make the color array via Less the problem and that this line of code I can not convert to Less you could tell me how it would look background: radial-gradient(Ellipse at center, $color 0%, Darken($color, 50%) 100%); it seems that the problem is that Darken do not know if it is called a different way in Less because when I compile the error in it
– Felipe Henrique
@hugocsl put up a bug print to see if I can clarify better
– Felipe Henrique