我在将Less与字体速记一起使用时发现了一个问题
.font(@weight: 300, @size: 22px, @height: 32px) { font: @weight @size/@height "Helvetica Neue", Arial, "Liberation Sans", FreeSans, sans-serif; }
以上失败
this.a.toCSS is not a function http://localhost/tumblr/modern1/css/style.less on line 1, column 0: 1. @highlight: #cb1e16; 2. @shade1: #cb1e16;
当我分割属性时它起作用
.font(@weight: 300, @size: 22px, @height: 32px) { font-weight: @weight; font-size: @size; line-height: @height; font-family: "Yanone Kaffeesatz", "Helvetica Neue", Arial, "Liberation Sans", FreeSans, sans-serif;
}
我认为这是因为斜杠/多数民众赞成在造成问题,我认为,因为较少可以做计算,例如。2px + 5 = 7px它试图做一个鸿沟?
2px + 5 = 7px
刚遇到这个问题,转义函数(无论如何对于less.js来说)是:e()像这样
font: @weight @size e('/') @height "Helvetica Neue", Arial, "Liberation Sans", FreeSans, sans-serif;