4 ms·
Can you use Bootstrap for a project without permanently modifying it? All my previous attempts I ended up gutting and heavily modifying Bootstrap, making me stu
by staunch 13y ago
Can you use Bootstrap for a project without permanently modifying it? All my previous attempts I ended up gutting and heavily modifying Bootstrap, making me stuck on whatever version I started with. Is there a good solution to this?
- jfrey 13y agoIf you use the .less sources in your project and compile them as part of your pipeline, you can affect bootstrap styles to a much larger degree with a much smaller set of changes. As an example, changing values in bootstrap\variables.less will propagate to all the other dependent less stylesheets. That's the approach I took for my latest project, and was able to upgrade from 3.0.1 to 3.0.3 this morning with very few headaches.
- elithrar 13y ago> As an example, changing values in bootstrap\variables.less will propagate to all the other dependent less stylesheets. You're better off actually creating a new stylesheet (or sheets) and importing only the Bootstrap LESS files you want. As long as your file is last in the import list, anything you override (variables) will take precedence. This will also make your upgrade path smoother, as the upgrade won't overwrite any of your mods. i.e. @import "bower_components/bootstrap/less/variables.less"; @import "bower_components/bootstrap/less/mixins.less"; // Rest of Bootstrap here @import "myappstylesheet.less";
- speg 13y agoYes, version 3 is not very aggressive in terms of styling. Simply apply your styles on top and you should be good to go. They even provide a simple theme to include to make it look more like the old one.
- coderdude 13y agoYou should override Bootstrap's styles in a separate stylesheet and combine them during a build step or serve them separately, with the custom styles served after Bootstrap's styles. That won't help with backwards compatibility issues but it makes it a lot easier to upgrade.
- wil421 13y agoI have used it on several projects and each time I have ended up doing modifications. What I do is make my own stylesheet to override boostrap. You usually get stuck using a certain version but it's getting easier to upgrade. I stay away from the grids so I have a little more control.