【问题标题】:twitter bootstrap version 3.0 rc1 NameError: .make-column is undefinedtwitter bootstrap 版本 3.0 rc1 NameError: .make-column 未定义
【发布时间】:2013-08-07 21:12:29
【问题描述】:

我正在使用 twitter bootstrap v 3.0 RC1,我安装了 node 和 npm,以便在保存 less 文件时将 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 混合是什么,我是新手,所以我想弄清楚如何正确地做到这一点,谢谢

【问题讨论】:

    标签: css twitter-bootstrap less sublimetext2 twitter-bootstrap-3


    【解决方案1】:

    您的代码有效(在 linux 上)

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

    结果,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's Bootstrap 3.x semantic mobile grid

    【讨论】:

      猜你喜欢
      • 2013-08-10
      • 2013-10-30
      • 2013-08-12
      • 2014-08-18
      • 1970-01-01
      • 1970-01-01
      • 2013-09-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多