A
A
Alex Pts2012-03-24 09:28:07
css
Alex Pts, 2012-03-24 09:28:07

Dynamic property names in .less

Is it possible to use variables in less as property names. From the class example it will be clearer what you want in the end

.my_attr(@param: opacity, @val: 1){
@param : @val;
}




This example will assign the value of @val to the variable @param.

Is it possible to do something in less so that in the end this example with default parameters is displayed?

opacity : 1;


Those. substituted variable values ​​everywhere.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
winbackgo, 2014-02-13
@AlexPTS

@{param}

A
Alex Pts, 2014-02-24
@AlexPTS

Thanks, I wish the IDE didn't swear at this syntax

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question