无法使twitter-bootstrap-rails mixin正常工作

时间:2018-12-04 15:23:25

标签: ruby-on-rails twitter-bootstrap twitter-bootstrap-rails

我在app/assets/stylesheets/scaffolds.scss中有以下CSS:

.input-container {
    @include make-lg-column(3);
}

当我加载页面时,出现以下错误:

  

未定义的mixin'make-lg-column'。

app/assets/stylesheets/bootstrap_and_overrides.css.less中有以下几行:

@import "twitter/bootstrap/variables.less";
@import "twitter/bootstrap/mixins.less";

这是我在app/assets/stylesheets/application.css中所拥有的:

/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 *= require bootstrap_and_overrides
 *= require_tree .
 *= require_self
 */

任何有关如何解决此问题的建议将不胜感激。

1 个答案:

答案 0 :(得分:0)

您似乎在LESS文件中的SCSS中使用了引导程序。我建议尝试使用SASS版本。

# Gemfile
gem 'bootstrap-sass', '~> 3.3.7'
gem 'sass-rails', '>= 3.2'

# SCSS file
@import "bootstrap-sprockets";
@import "bootstrap";