Compass CSS framework - using Bootstrap with SASS

前端 未结 1 1414
隐瞒了意图╮
隐瞒了意图╮ 2021-01-26 08:04

I want to use Bootstrap with SASS, but I can\'t find any tutorials or explanation how one can use Bootstrap with SASS. The only thing I find is installatio trough a ruby gem:

相关标签:
1条回答
  • 2021-01-26 08:52

    (I'm using .sass files in my answer, but it should apply to .scss files, too)

    Isn't there a bootstrap.scss file that has all the mixins and everything else?

    Yes, there is. Here's the generated styles.sass file:

    // Import Bootstrap Compass integration
    @import "bootstrap-compass"
    // Import custom Bootstrap variables
    @import "bootstrap-variables"
    // Import Bootstrap for Sass
    @import "bootstrap"
    

    bootstap_variables refers to the generated _bootstrap-variables.sass file in your project tree, whereas bootstrap-compass and bootstrap are imported from the gem's stylesheets directory.

    The latter imports all other Bootstrap files, including the grid:

    // Core variables and mixins
    @import "bootstrap/variables";
    @import "bootstrap/mixins";
    
    // Reset and dependencies
    @import "bootstrap/normalize";
    @import "bootstrap/print";
    @import "bootstrap/glyphicons";
    
    // Core CSS
    @import "bootstrap/scaffolding";
    @import "bootstrap/type";
    @import "bootstrap/code";
    @import "bootstrap/grid";        # <-- here it is
    ...
    
    0 讨论(0)
提交回复
热议问题