LESS - Mixin作为可变参数

时间:2015-09-24 08:07:36

标签: css twitter-bootstrap less

我正在导入bootstrap文件并重写源变量,例如:

@import "./../../../../vendor/bootstrap/less/scaffolding.less";
@import "./../../../../vendor/bootstrap/less/type.less";
@import "./../../../../vendor/bootstrap/less/code.less";
@import "./../../../../vendor/bootstrap/less/grid.less";
@import "./../../../../vendor/bootstrap/less/tables.less";
@import "./../../../../vendor/bootstrap/less/forms.less";
@import "./../../../../vendor/bootstrap/less/buttons.less";
//etc ...

@font-size-base: 100%;

然后在我自己的变量中。我设置了类似的东西,一个用于rem字体大小调整的混合

.font-size(@sizeValue) {
  @remValue: @sizeValue;
  @pxValue: (@sizeValue * 10);
  font-size: ~"@{pxValue}px";
  font-size: ~"@{remValue}rem";
}

现在,当然,我不明白我是如何让它工作的,这是我想要的,它不起作用(输入无法识别):

// In bootstrap import file, trying to overwrite their variable parameter with my mixin
@font-size-h2: .font-size(32);

任何方式做我想做的事情?

0 个答案:

没有答案