较少CSS - 无法划分两个像素单位并返回无单位值

Vit*_*min 8 css less web

我想(临时)删除我的变量的单位@baseLineHeight@baseFontSize,这样我可以把他们得到相对line-height.这就是我尝试过的:

@baseFontSize: 12px;
@baseLineHeight: 18px;
font: @baseFontSize~"/"@baseLineHeight/@baseFontSize sans-serif;
Run Code Online (Sandbox Code Playgroud)

生成以下错误:

Object #<Object> has no method 'toCSS' (Less::ParseError)
Run Code Online (Sandbox Code Playgroud)

首选输出:

font: 12px/1.5 sans-serif;
Run Code Online (Sandbox Code Playgroud)

Nik*_*ter 6

同时似乎有一个功能:http: //lesscss.org/functions/#misc-functions-unit

这里是评论的代码,只是为了完整性.(感谢cfx).

font: @baseFontSize~"/"unit(@baseLineHeight/@baseFontSize) sans-serif;
Run Code Online (Sandbox Code Playgroud)