2
How can I call a variable from other variables as in other languages in Less?
PHP:
$name = 'stack';
$level = '900';
$nameVariable = $name . $level;
${$nameVariable}; // chama variável: $stack900
$$nameVariable; // chamar variável: $stack900
2
How can I call a variable from other variables as in other languages in Less?
PHP:
$name = 'stack';
$level = '900';
$nameVariable = $name . $level;
${$nameVariable}; // chama variável: $stack900
$$nameVariable; // chamar variável: $stack900
2
Oops, after trying hard I got!!!
Less:
@name: stack;
@level: 900;
@nameVariable: ~'@{name}@{level}';
@@nameVariable; // chama variável: @stack900
Why to use @{name}@{level}
instead of @name@level
is:
Example:
@{name}@{level} // stack900
@name@level // stack 900
and the ~
is to remove the quotes ' '
Browser other questions tagged variables less
You are not signed in. Login or sign up in order to post.