cloud4bpm's avatar

How extend some variables or behavior of Bootstrap with SASS using Elixir?

Hi,

I'm trying to extend some variables and behavior of Bootstrap(version 4.0.0-alpha although I think must be the same for the 3.3.5 version). The process I use is:

  1. Use bower as follow:

    bower install jquery bootstrap#v4.0.0-alpha --save-dev
    
  2. Modify the install path of the bower.json file:

    "install" :
        {
            "path": "resources/assets/vendor"
        }
    
  3. Use bower-installer for create the js and css files (in Bootstrap 4.0 creates the scss file, then you need to compile).

  4. Then I mayuse gulp and Elixir for compile all files. But here is the question how can I change any variable without touch the original and managed by bower files? I was using:

    elixir(function(mix){
        mix.sass(['_variables.scss', 'vendor/bootstrap.bootstrap.scss']);
    });
    

Where the _variables.scss contains only some customized vars.

How would you proceed to make changes within the original SASS variables?

In example to extend or modify the $primaryColor variable, or change the new FlexBox feature.

Thanks

0 likes
4 replies
bobbybouwmann's avatar
Level 88

Just override the variables in your sass file. Make sure that your file is called before the sass compiles to css.

cloud4bpm's avatar

Many thanks @bobbybouwmann, I tried that without success.

Is possible to override within the resources/assets/sass folder or I need to use the original bower_components/bootstrap/ folder?

Please, could you put some small example?

Thanks for your quick answer.

Please or to participate in this conversation.