2

我正在使用 twitter bootstrap v 3.0 RC1,并在保存 less 文件时安装了 node 和 npm 以将 less 编译为 css。

我将 bootstrap.css 文件包含在我的 html 头中,当我保存 bootstrap.less 时,它会像您期望的那样将其编译成 css。

我在 bootstrap/less 目录中创建了另一个 .less 文件(theme.less) theme.less 文件:

NameError: .make-column is undefined in /path/to/assets/bootstrap/less/theme.less

/* ------- Theme styling ------- */
.content-body {
    .make-column(10);
}

我认为它是未定义的,因为 theme.less 不知道 .make-column 混合是什么,我是新手,所以我想弄清楚如何正确地做到这一点,谢谢

4

1 回答 1

1

您的代码有效(在 linux 上)

  1. 如上所述创建theme.less
  2. 在bootstrap.less@import "theme.less"; 末尾添加
  3. grunt dist通过在 bootstrap 文件夹或lessc bootstrap.lessless 文件夹中运行进行编译

结果,bootstrap.css 的最后几行包含:

/* ------- Theme styling ------- */

.content-body {
  position: relative;
  min-height: 1px;
  padding-right: 15px;
  padding-left: 15px;
}

@media (min-width: 768px) {
  .content-body {
    float: left;
    width: 83.33333333333334%;
  }

参见:Twitter 的 Bootstrap 3.x 语义移动网格

于 2013-08-06T20:15:02.880 回答