5

When I use Bower to install something like bootstrap-sass-official, it installs it in the bower_components directory. A component like Bootstrap allows for customization by editing the file bower_components/assets/stylesheets/_bootstrap.scss. In this case, you simple pick and choose which parts of Bootstrap you want to use for your project.

It is well known that it is most efficient and best practice to leave packages and components like ./bower_components, ./vendor, ./node_modules etc out of source control. But the problem with this is that when others download your source and install the bower dependencies, your customizations are never installed.

So, assuming that you are following best practices and keeping bower_components out of source control, where is the best place to customize a component like Bootstrap? Simply copy _bootstrap.scss to a source-controlled directory and customize it there? Or is there a more elegant approach?

Jake Wilson
  • 88,616
  • 93
  • 252
  • 370

1 Answers1

0

I believe you are correct in saying that the most elegant solution is to copy the _bootstrap.scss file to your project structure. You could then remove the bootstrap components that you wish to exclude, and modify the paths of the remaining components to point to your bower_components directory. In this way you get full customization over the library while only maintaining a single file.

This answer might also be helpful to those looking into this issue.

Community
  • 1
  • 1
Zach Olivare
  • 3,805
  • 3
  • 32
  • 45
  • I came to the same conclusion. Unfortunately this approach kind of defeats the purpose of easily installable components via bower. Oh well. Thank you, – Jake Wilson May 16 '16 at 01:59