1

I have the following piece of CSS in app/assets/stylesheets/scaffolds.scss:

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

When I load the page I get the following error:

Undefined mixin 'make-lg-column'.

I have the following lines present in app/assets/stylesheets/bootstrap_and_overrides.css.less:

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

This is what I have in 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
 */

Any suggestions on how to troubleshoot this would be appreciated.

Jason Swett
  • 43,526
  • 67
  • 220
  • 351

1 Answers1

0

You seem to use bootstrap with LESS in a SCSS file. I'd suggest to try the SASS version.

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

# SCSS file
@import "bootstrap-sprockets";
@import "bootstrap";
mrzasa
  • 22,895
  • 11
  • 56
  • 94
  • I'll accept this because it speaks to the root of my problem - I got mixed up about Less and Sass - although my solution was not to switch to Sass but to create a new `.less` file and apply the mixin there. – Jason Swett Dec 05 '18 at 19:02
  • Then you should transform `app/assets/stylesheets/scaffolds.scss` to less or create another stylesheet file using LESS and use the LESS mixins there. – mrzasa Dec 06 '18 at 08:15