Concatenate string and var less css

后端 未结 6 1482
滥情空心
滥情空心 2020-12-09 10:01

Can anyone please tell me how to concatenate a var and a string in LESS so I don\'t have the space between them?

I have the following code:

.text(@si         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-09 10:38

    this is how I recently solved a similar problem.

    .text(@size: 10) {
      font-size: e(%("%dpx", @size));
      line-height: e(%("%dem", @size/10));
    }
    

    The %("string", value) function simply format a string and so it take the %d inside the string and transform it in whatever is value. an example here: http://cdpn.io/hAbwl

    Hope this can help.

提交回复
热议问题