我注意到使用Less with font速记时出现问题
.font(@weight: 300, @size: 22px, @height: 32px) {
font: @weight @size/@height "Helvetica Neue", Arial, "Liberation Sans", FreeSans, sans-serif;
}
Run Code Online (Sandbox Code Playgroud)
以上失败了
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;
Run Code Online (Sandbox Code Playgroud)
当我拆分属性时它起作用
.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;
Run Code Online (Sandbox Code Playgroud)
}
我认为它是因为斜线/那导致问题,我认为因为Less可以做计算,例如.2px + 5 = 7px它试图划分?