当前位置: 动力学知识库 > 问答 > 编程问答 >

css - String concat in Google Closure stylesheets?

问题描述:

I simply have the code

@def WIDTH 50 // will be reused

// ...

width: @def WIDTH px // incorrect space between

I believe CSS doesn't allow the space between # and px which makes this code wrong. But I haven't found a string concat function. Is there a way to do this?

I'm aware I can @def WIDTH to be 50px, that will break its reuse.

网友答案:

A correct Closure solution to this problem is to mult by the unit.

width: mult(1px, WIDTH);
分享给朋友:
您可能感兴趣的文章:
随机阅读: