Dynamically define a variable in LESS CSS

前端 未结 4 962
独厮守ぢ
独厮守ぢ 2020-12-06 02:12

I am trying to create a mixin that dynamically defines variables in LESS CSS, by actually assigning them a composite name.

The simplified use-case (not the real one)

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-06 02:34

    I don’t have time to build out the examples, but none of the above are as quick and simple as defining a variable and then assembling the import based on it. Then just have multiple documents where the same variables are defined.

    @whitelabel: 'foo';
    @import 'whitelabel/@{whitelabel}/colors';
    

提交回复
热议问题