Colors in Bootstrap custom download?

2019-03-02 07:08发布

So I'm using the Bootstrap Customize and Download page to generate a version of the Bootstrap files with custom colors. I got the idea that I wanted to add some other colors (e.g. @purpleLight) to make upkeep of the site design easier, so I look through the downloaded contents the site generates, and my customizations don't appear to be anywhere, let alone somewhere for me to add others. Here's what comes in the bootstrap.zip the site spits out:

  • css
    • bootstrap.css
    • bootstrap.min.css
  • img
    • glyphicons-halflings.png
    • glyphicons-halflings-white.png
  • js
    • bootstrap.js
    • bootstrap.min.js

...and that's it. So, no colors anywhere in these files as far as I can tell. No LESS files included in the download. Am I doing something wrong? Is the site doing something wrong? Am I just not seeing something that is in fact there? To the best of my diffing abilities, the downloads seem identical regardless of the customization options I choose...

And, pending whose messing up here, what would be the alternative best way for me to customize a color palette for my Bootstrap site?

1条回答
时光不老,我们不散
2楼-- · 2019-03-02 07:52

You can't add more LESS variables with the custom download tool. You can only redefine the values of the existing variables. Upon download, the tool compiles with those set variables but since you don't get the LESS files, you won't be able to add more variables afterwards, like @purpleLight you mentioned.

If you want to extend Bootstrap with more LESS variables, you have to download the full source and compile your css from the included LESS files. There's a file variables.less in the less/ folder where can add your @purpleLight.

查看更多
登录 后发表回答