Victor
Victor

Reputation: 13368

How to use twitter bootstrap-sass mixins

Using Rails 3.

Right now in each new .css.scss file that I am creating, I want to be able to use the mixins, but I just couldn't seem to use it.

Here is my bootstrap_import.css.scss:

// Import bootstrap
// --------------------------------------------------
@import "bootstrap";
@import "bootstrap-responsive";
@media (min-width: 1200px) {
  .span12, .container {
    width: 1170px;
  }
}
@import "base";

When I have another file called a.css.scss and I try to @include border-radius(12px);, but it just gives this error:

Undefined mixin 'border-radius'.

Same goes to variables, I would like to change some colors on some variables so that I can use it on any file without needing to include in each CSS file.

Thank you.

Upvotes: 2

Views: 9534

Answers (2)

Mukesh kumar
Mukesh kumar

Reputation: 63

I followed this guidelines and I was able to fix the error "undefined border-radius". https://github.com/thomas-mcdonald/bootstrap-sass

Upvotes: 0

theforce
theforce

Reputation: 1525

Only one import works in my project, probably a bug or a mistake from my side.

My solution with bootstrap-sass v2.0.3.1 to achieve a solution is: (not 100% what do you expect, I know..)

I create a new scss file like: myAppBase.css.scss

/* override bootstrap default variables */
$linkColor:      #FF0000;
$linkColorHover: #000;

@import "bootstrap";

/* App variables */
$bgImage: url('bg.jpg');
$radius: 4px;
$maxHeight:600px;
$minHeight:400px;
$bSize:1px;

and if i need bootstrap and my variables in an other *.css.scss file. I include this line on the top:

@import  "myAppBase";

Upvotes: 3

Related Questions