我想(暂时)删除我的变量@baseLineHeight
和@baseFontSize
的单位,以便我可以划分它们获得相对的 line-height
。这是我试过的:
@baseFontSize: 12px;
@baseLineHeight: 18px;
font: @baseFontSize~"/"@baseLineHeight/@baseFontSize sans-serif;
生成以下错误:
Object #<Object> has no method 'toCSS' (Less::ParseError)
首选输出:
font: 12px/1.5 sans-serif;
最佳答案
与此同时似乎有一个函数: http://lesscss.org/functions/#misc-functions-unit
这里是评论中的代码,只是为了完整性。 (感谢 cfx)。
font: @baseFontSize~"/"unit(@baseLineHeight/@baseFontSize) sans-serif;
关于css - LESS CSS - 无法划分两个像素单元并返回无单元值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9382997/