Gathering detailed insights and metrics for bootstrap-sass
Gathering detailed insights and metrics for bootstrap-sass
Gathering detailed insights and metrics for bootstrap-sass
Gathering detailed insights and metrics for bootstrap-sass
bootstrap3-sass
bootstrap-sass is a Sass-powered version of Bootstrap 3, ready to drop right into your Sass powered applications.
@talend/bootstrap-sass
bootstrap-sass is a Sass-powered version of Bootstrap 3, ready to drop right into your Sass powered applications.
nw-style-guide
A library of components based on Bootstrap Sass 3.x
bootswatch-sass
Bootswatch is a collection of themes for Bootstrap. SASS / SCSS edition
npm install bootstrap-sass
99.9
Supply Chain
99.6
Quality
80.9
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
12,579 Stars
1,041 Commits
3,528 Forks
543 Watching
10 Branches
122 Contributors
Updated on 28 Nov 2024
SCSS (55.9%)
JavaScript (19.43%)
Ruby (16.46%)
Sass (7.31%)
Slim (0.72%)
Shell (0.09%)
HTML (0.08%)
Cumulative downloads
Total Downloads
Last day
-22.1%
35,080
Compared to previous day
Last week
-9.8%
213,237
Compared to previous week
Last month
-4%
976,248
Compared to previous month
Last year
-6.3%
14,087,741
Compared to previous year
bootstrap-sass
is a Sass-powered version of Bootstrap 3, ready to drop right into your Sass powered applications.
This is Bootstrap 3. For Bootstrap 4 use the Bootstrap rubygem if you use Ruby, and the main repo otherwise.
Please see the appropriate guide for your environment of choice:
bootstrap-sass
is easy to drop into Rails with the asset pipeline.
In your Gemfile you need to add the bootstrap-sass
gem, and ensure that the sass-rails
gem is present - it is added to new Rails applications by default.
1gem 'bootstrap-sass', '~> 3.4.1' 2gem 'sassc-rails', '>= 2.1.0'
bundle install
and restart your server to make the files available through the pipeline.
Import Bootstrap styles in app/assets/stylesheets/application.scss
:
1// "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables" 2@import "bootstrap-sprockets"; 3@import "bootstrap";
bootstrap-sprockets
must be imported before bootstrap
for the icon fonts to work.
Make sure the file has .scss
extension (or .sass
for Sass syntax). If you have just generated a new Rails app,
it may come with a .css
file instead. If this file exists, it will be served instead of Sass, so rename it:
1$ mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss
Then, remove all the *= require_self
and *= require_tree .
statements from the sass file. Instead, use @import
to import Sass files.
Do not use *= require
in Sass or your other stylesheets will not be able to access the Bootstrap mixins or variables.
Bootstrap JavaScript depends on jQuery.
If you're using Rails 5.1+, add the jquery-rails
gem to your Gemfile:
1gem 'jquery-rails'
1$ bundle install
Require Bootstrap Javascripts in app/assets/javascripts/application.js
:
1//= require jquery 2//= require bootstrap-sprockets
bootstrap-sprockets
and bootstrap
should not both be included in application.js
.
bootstrap-sprockets
provides individual Bootstrap Javascript files (alert.js
or dropdown.js
, for example), while
bootstrap
provides a concatenated file containing all Bootstrap Javascripts.
When using bootstrap-sass Bower package instead of the gem in Rails, configure assets in config/application.rb
:
1# Bower asset paths 2root.join('vendor', 'assets', 'bower_components').to_s.tap do |bower_path| 3 config.sass.load_paths << bower_path 4 config.assets.paths << bower_path 5end 6# Precompile Bootstrap fonts 7config.assets.precompile << %r(bootstrap-sass/assets/fonts/bootstrap/[\w-]+\.(?:eot|svg|ttf|woff2?)$) 8# Minimum Sass number precision required by bootstrap-sass 9::Sass::Script::Value::Number.precision = [8, ::Sass::Script::Value::Number.precision].max
Replace Bootstrap @import
statements in application.scss
with:
1$icon-font-path: "bootstrap-sass/assets/fonts/bootstrap/"; 2@import "bootstrap-sass/assets/stylesheets/bootstrap-sprockets"; 3@import "bootstrap-sass/assets/stylesheets/bootstrap";
Replace Bootstrap require
directive in application.js
with:
1//= require bootstrap-sass/assets/javascripts/bootstrap-sprockets
Please make sure sprockets-rails
is at least v2.1.4.
bootstrap-sass is no longer compatible with Rails 3. The latest version of bootstrap-sass compatible with Rails 3.2 is v3.1.1.0.
bootstrap-sass Bower package is compatible with node-sass 3.2.0+. You can install it with:
1$ bower install bootstrap-sass
Sass, JS, and all other assets are located at assets.
By default, bower.json
main field list only the main _bootstrap.scss
and all the static assets (fonts and JS).
This is compatible by default with asset managers such as wiredep.
If you use mincer with node-sass, import Bootstrap like so:
In application.css.ejs.scss
(NB .css.ejs.scss):
1// Import mincer asset paths helper integration 2@import "bootstrap-mincer"; 3@import "bootstrap";
In application.js
:
1//= require bootstrap-sprockets
See also this example manifest.js for mincer.
1$ npm install bootstrap-sass
By default all of Bootstrap is imported.
You can also import components explicitly. To start with a full list of modules copy
_bootstrap.scss
file into your assets as _bootstrap-custom.scss
.
Then comment out components you do not want from _bootstrap-custom
.
In the application Sass file, replace @import 'bootstrap'
with:
1@import 'bootstrap-custom';
bootstrap-sass requires minimum Sass number precision of 8 (default is 5).
Precision is set for Ruby automatically when using the sassc-rails
gem.
When using the npm or Bower version with Ruby, you can set it with:
1::Sass::Script::Value::Number.precision = [8, ::Sass::Script::Value::Number.precision].max
Bootstrap requires the use of Autoprefixer. Autoprefixer adds vendor prefixes to CSS rules using values from Can I Use.
To match upstream Bootstrap's level of browser compatibility, set Autoprefixer's browsers
option to:
1[ 2 "Android 2.3", 3 "Android >= 4", 4 "Chrome >= 20", 5 "Firefox >= 24", 6 "Explorer >= 8", 7 "iOS >= 6", 8 "Opera >= 12", 9 "Safari >= 6" 10]
assets/javascripts/bootstrap.js
contains all of Bootstrap's JavaScript,
concatenated in the correct order.
If you use Sprockets or Mincer, you can require bootstrap-sprockets
instead to load the individual modules:
1// Load all Bootstrap JavaScript 2//= require bootstrap-sprockets
You can also load individual modules, provided you also require any dependencies. You can check dependencies in the Bootstrap JS documentation.
1//= require bootstrap/scrollspy 2//= require bootstrap/modal 3//= require bootstrap/dropdown
The fonts are referenced as:
1"#{$icon-font-path}#{$icon-font-name}.eot"
$icon-font-path
defaults to bootstrap/
if asset path helpers are used, and ../fonts/bootstrap/
otherwise.
When using bootstrap-sass with Compass, Sprockets, or Mincer, you must import the relevant path helpers before Bootstrap itself, for example:
1@import "bootstrap-compass"; 2@import "bootstrap";
Import Bootstrap into a Sass file (for example, application.scss
) to get all of Bootstrap's styles, mixins and variables!
1@import "bootstrap";
You can also include optional Bootstrap theme:
1@import "bootstrap/theme";
The full list of Bootstrap variables can be found here. You can override these by simply redefining the variable before the @import
directive, e.g.:
1$navbar-default-bg: #312312; 2$light-orange: #ff8c00; 3$navbar-default-color: $light-orange; 4 5@import "bootstrap";
Bootstrap is available as an Eyeglass module. After installing Bootstrap via NPM you can import the Bootstrap library via:
1@import "bootstrap-sass/bootstrap"
or import only the parts of Bootstrap you need:
1@import "bootstrap-sass/bootstrap/variables"; 2@import "bootstrap-sass/bootstrap/mixins"; 3@import "bootstrap-sass/bootstrap/carousel";
Bootstrap for Sass version may differ from the upstream version in the last number, known as PATCH. The patch version may be ahead of the corresponding upstream minor. This happens when we need to release Sass-specific changes.
Before v3.3.2, Bootstrap for Sass version used to reflect the upstream version, with an additional number for Sass-specific changes. This was changed due to Bower and npm compatibility issues.
The upstream versions vs the Bootstrap for Sass versions are:
Upstream | Sass |
---|---|
3.3.4+ | same |
3.3.2 | 3.3.3 |
<= 3.3.1 | 3.3.1.x |
Always refer to CHANGELOG.md when upgrading.
If you'd like to help with the development of bootstrap-sass itself, read this section.
Keeping bootstrap-sass in sync with upstream changes from Bootstrap used to be an error prone and time consuming manual process. With Bootstrap 3 we have introduced a converter that automates this.
Note: if you're just looking to use Bootstrap 3, see the installation section above.
Upstream changes to the Bootstrap project can now be pulled in using the convert
rake task.
Here's an example run that would pull down the master branch from the main twbs/bootstrap repo:
rake convert
This will convert the latest LESS to Sass and update to the latest JS. To convert a specific branch or version, pass the branch name or the commit hash as the first task argument:
rake convert[e8a1df5f060bf7e6631554648e0abde150aedbe4]
The latest converter script is located here and does the following:
assets/javascripts/bootstrap
, a Sprockets manifest at assets/javascripts/bootstrap-sprockets.js
, and a concatenation at assets/javascripts/bootstrap.js
.assets/fonts/bootstrap
.Bootstrap::BOOTSTRAP_SHA
in version.rb to the branch sha.This converter fully converts original LESS to SCSS. Conversion is automatic but requires instructions for certain transformations (see converter output).
Please submit GitHub issues tagged with conversion
.
bootstrap-sass has a number of major contributors:
and a significant number of other contributors.
bootstrap-sass is used to build some awesome projects all over the web, including Diaspora, rails_admin, Michael Hartl's Rails Tutorial, gitlabhq and kandan.
The latest stable version of the package.
Stable Version
5
6.1/10
Summary
Bootstrap Cross-site Scripting vulnerability
Affected Versions
>= 2.0.4, < 3.4.0
Patched Versions
3.4.0
6.1/10
Summary
Bootstrap Cross-site Scripting vulnerability
Affected Versions
>= 2.0.4, < 3.4.0
Patched Versions
3.4.0
6.1/10
Summary
XSS vulnerability that affects bootstrap
Affected Versions
< 3.4.0
Patched Versions
3.4.0
6.1/10
Summary
bootstrap Cross-site Scripting vulnerability
Affected Versions
< 3.4.0
Patched Versions
3.4.0
6.1/10
Summary
Bootstrap Vulnerable to Cross-Site Scripting
Affected Versions
>= 3.0.0, < 3.4.1
Patched Versions
3.4.1
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 4/28 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
31 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More