Why does Bootstrap include a bootstrap-theme file?

后端 未结 2 1556
离开以前
离开以前 2021-02-01 16:35

The question is similar to this one: How to use bootstrap-theme.css with bootstrap 3? but not a duplicate. I\'m interacting with Bootstrap at .less level and recompilin

2条回答
  •  深忆病人
    2021-02-01 17:32

    I started a bug on this and got this response:

    We're not separating the docs into another repo because it makes it much more painful/difficult to keep them up-to-date with changes to the code.

    Pretty pathetic IMO but it's not my project to manage. After an hour of asking I went with combining the first two options. I added the following to the very last line of bootstrap.less:

    @import "theme.less";
    

    To make that work in reality, there are a couple of alterations required:

    • Clean up the Gruntfile to stop building the separate theme
    • Removing Bootstrap imports from the top of the theme.less file (causes a loop if you don't)

    But the output is as desired. One fat bootstrap.css file and a slightly slimmer bootstrap.min.css file.

    I still don't feel like hacking the whole build process is a very sustainable method of using Bootstrap as a starter theme. Very open to better solutions.


    In another project I have dumped the final import and I'm just doing all my work in bootstrap.less. Sure, there are 50 lines at the top that are a load of boilerplate imports but it means I'm not hopping between files nearly as much. I know what's being included all the time.

    I also removed grunt and went with my own fabric solution that was already used in my existing workflow. As ever, your mileage may vary. You're not me.

提交回复
热议问题