Bootstrap Sass with Rails 4

前端 未结 2 2011
一个人的身影
一个人的身影 2021-01-07 08:51

I\'m trying to use bootstrap-sass (3.1.0.2) and sass-rails (4.0.1) in my rails (4.0.0) project.

My application.css.scss file looks like this:

/*
 * T         


        
2条回答
  •  既然无缘
    2021-01-07 09:07

    I faced nearly the same problem few days ago. My configuration was quite the same but only few styling effects of Bootstrap were not working (especially the bg-whatever-color). After few gems updated the problem disappear.

    Some of my gems that I updated

    gem 'rails', '4.0.3'
    gem "bootstrap-sass", "~> 3.1.1.0"
    gem 'font-awesome-sass'
    gem 'sass-rails', '~> 4.0.0'
    

    Don't forget the:

    bundle update
    

    Part of my application.scss to give you an idea

    *= require jquery.ui.all
    *= require select2
    *= require font-awesome
    */
    
    @import "mixin_and_var";
    // changing the breakpoint value before importing bootstrap style
    // This change is made for the menu (navbar) to collapse on tablet for better view
    $screen-sm:1024px;
    @import "bootstrap";
    
    @import "general_layout";
    @import "header";
    @import "footer";
    @import "menus";
    @import "pagination";
    @import 'login';
    @import "error";
    

    Hope it helps!

提交回复
热议问题