Skip to content

Commit

Permalink
Remove compass support
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed Dec 14, 2018
1 parent 489b6f2 commit 6634d0a
Show file tree
Hide file tree
Showing 12 changed files with 234 additions and 388 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
dist: xenial
language: ruby
cache: bundler
bundler_args: --path ../../vendor/bundle --without debug
rvm:
- 2.2.3
- 2.5.1
gemfile:
- test/gemfiles/sass_3_3.gemfile
- test/gemfiles/sass_3_4.gemfile
- test/gemfiles/default.gemfile
before_install:
- "nvm install stable"
- "npm install"
Expand Down
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ source 'https://rubygems.org'

gemspec

# Compass for the dummy app
gem 'compass', require: false

group :development do
gem 'byebug', platform: :mri, require: false
end
57 changes: 7 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ This is Bootstrap **3**. For Bootstrap **4** use the [Bootstrap rubygem](https:/
Please see the appropriate guide for your environment of choice:

* [Ruby on Rails](#a-ruby-on-rails).
* [Compass](#b-compass-without-rails) not on Rails.
* [Bower](#c-bower).
* [npm / Node.js](#d-npm--nodejs).
* [Bower](#b-bower).
* [npm / Node.js](#c-npm--nodejs).

### a. Ruby on Rails

Expand All @@ -25,7 +24,7 @@ In your Gemfile you need to add the `bootstrap-sass` gem, and ensure that the `s

```ruby
gem 'bootstrap-sass', '~> 3.3.7'
gem 'sass-rails', '>= 3.2'
gem 'sassc-rails', '>= 1.3.0'
```

`bundle install` and restart your server to make the files available through the pipeline.
Expand Down Expand Up @@ -112,49 +111,7 @@ 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.

### b. Compass without Rails

Install the gem:

```console
$ gem install bootstrap-sass
```

If you have an existing Compass project:

1. Require `bootstrap-sass` in `config.rb`:

```ruby
require 'bootstrap-sass'
```

2. Install Bootstrap with:

```console
$ bundle exec compass install bootstrap -r bootstrap-sass
```

If you are creating a new Compass project, you can generate it with bootstrap-sass support:

```console
$ bundle exec compass create my-new-project -r bootstrap-sass --using bootstrap
```

or, alternatively, if you're not using a Gemfile for your dependencies:

```console
$ compass create my-new-project -r bootstrap-sass --using bootstrap
```

This will create a new Compass project with the following files in it:

* [styles.sass](/templates/project/styles.sass) - main project Sass file, imports Bootstrap and variables.
* [_bootstrap-variables.sass](/templates/project/_bootstrap-variables.sass) - all of Bootstrap variables, override them here.

Some bootstrap-sass mixins may conflict with the Compass ones.
If this happens, change the import order so that Compass mixins are loaded later.

### c. Bower
### b. Bower

bootstrap-sass Bower package is compatible with node-sass 3.2.0+. You can install it with:

Expand Down Expand Up @@ -187,7 +144,7 @@ In `application.js`:

See also this [example manifest.js](/test/dummy_node_mincer/manifest.js) for mincer.

### d. npm / Node.js
### c. npm / Node.js
```console
$ npm install bootstrap-sass
```
Expand All @@ -212,8 +169,8 @@ In the application Sass file, replace `@import 'bootstrap'` with:

bootstrap-sass [requires](https://github.com/twbs/bootstrap-sass/issues/409) minimum [Sass number precision][sass-precision] of 8 (default is 5).

Precision is set for Rails and Compass automatically.
When using Ruby Sass compiler standalone or with the Bower version you can set it with:
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:

```ruby
::Sass::Script::Value::Number.precision = [8, ::Sass::Script::Value::Number.precision].max
Expand Down
5 changes: 4 additions & 1 deletion lib/bootstrap-sass.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ def load!
elsif defined?(::Sass) && ::Sass.respond_to?(:load_paths)
# The deprecated `sass` gem:
::Sass.load_paths << stylesheets_path
end

if defined?(::Sass::Script::Value::Number)
# bootstrap requires minimum precision of 8, see https://github.com/twbs/bootstrap-sass/issues/409
::Sass::Script::Number.precision = [8, ::Sass::Script::Number.precision].max
::Sass::Script::Value::Number.precision = [8, ::Sass::Script::Value::Number.precision].max
end
end

Expand Down
Loading

0 comments on commit 6634d0a

Please sign in to comment.