Brian
Brian

Reputation: 1028

Possible to install just Bootstrap CSS with Bower?

Starting a new Angular project via Yeoman asks if you want to include Twitter Bootstrap (I'm using Sass flavor). Doing so includes both the styles and scripts. However, I want to use UI Bootstrap instead of Bootstrap's scripts (which depend on jQuery).

So, is it possible to install only Bootstrap's styles (preferably in Sass) with Bower? Or do I just need to download and include the Bootstrap styles manually?

Upvotes: 24

Views: 8704

Answers (5)

fallwind
fallwind

Reputation: 159

You can execute:

bower install bootstrap-css-only

Upvotes: 3

Nolan Lawrence
Nolan Lawrence

Reputation: 312

if you don't have a bowerInstall task in your gruntfile as mentioned in the accepted answer, this also works in the wiredep task.

 wiredep: {
  app: {
    src: ['<%= yeoman.app %>/index.html'],
    exclude: ['bower_components/bootstrap/dist/js/bootstrap.js'],
    ignorePath:  /\.\.\//
  },

Upvotes: 3

bkaid
bkaid

Reputation: 52073

Based on this answer, you could add this to .bowerrc to delete the Bootstrap JS files:

{ "directory": "bower_components", "scripts": { "postinstall": "rm -rf bower_components/bootstrap-sass-official/assets/javascripts" } }

Upvotes: 3

xiaoboa
xiaoboa

Reputation: 1953

just add exclude option in grunt bowerInstall task, and bowerInstall task will not inject the excluded file in the html file

bowerInstall: {
  app: {
    src: ['<%= yeoman.app %>/index.html'],
    exclude: ['bower_components/bootstrap/dist/js/bootstrap.js'],
    ignorePath: '<%= yeoman.app %>/'
  }
},

Upvotes: 14

tungd
tungd

Reputation: 14897

I know one CSS-only Bootstrap packages in Bower: bootstrap-css-only; However it comes with precompiled CSS but not SASS.

Upvotes: 17

Related Questions