首页 > less没有自定义函数吗~~

less没有自定义函数吗~~

官方例子

.average(@x, @y) {
  @average: ((@x + @y) / 2);
}

div {
  .average(16px, 50px); // "call" the mixin
  padding: @average;    // use its "return" value

  .average(40px, 50px);  //  这样就杯具了
  margin: @average; // average覆盖不了
}

有好的解决方案吗```` only less


没有 虽然我很不想说


支持的!

看这个插件 https://github.com/seven-phases-max/less-plugin-functions

【热门文章】
【热门文章】