compass-rails 1.1.0.pre → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +46 -32
- data/lib/compass-rails/version.rb +1 -1
- metadata +5 -5
data/README.md
CHANGED
@@ -29,6 +29,8 @@ And then execute:
|
|
29
29
|
|
30
30
|
$ bundle
|
31
31
|
|
32
|
+
## Optional
|
33
|
+
|
32
34
|
To set up your project with starter stylesheets and a configuration
|
33
35
|
file:
|
34
36
|
|
@@ -40,21 +42,28 @@ If using a compass-based framework (like [susy](http://susy.oddbird.net/) or [bl
|
|
40
42
|
|
41
43
|
Note that the `compass init` step is optional if you have a project running Rails 3.0 or greater.
|
42
44
|
|
43
|
-
##
|
45
|
+
## Usage
|
44
46
|
|
45
|
-
|
47
|
+
Change your `application.css` to `application.css.scss` or `application.css.sass` and use `@import` to your hearts content. Ex:
|
46
48
|
|
47
|
-
|
48
|
-
|
49
|
-
|
49
|
+
```scss
|
50
|
+
@import "project/mixins";
|
51
|
+
@import "project/base";
|
50
52
|
|
51
|
-
|
52
|
-
2. Configure your project to look in the **legacy location** of
|
53
|
-
`app/stylesheets` by setting `config.compass.sass_dir =
|
54
|
-
"app/stylesheets"` in your rails configuration or by setting
|
55
|
-
`sass_dir = "app/stylesheets"` in your compass configuration file.
|
53
|
+
```
|
56
54
|
|
57
|
-
|
55
|
+
*or*
|
56
|
+
|
57
|
+
Use `application.css` to require files that use compass features. Ex:
|
58
|
+
```css
|
59
|
+
/*
|
60
|
+
*= require styleguide_full_of_compass_stuff
|
61
|
+
*/
|
62
|
+
```
|
63
|
+
|
64
|
+
*Don't* use `*= require something` within your SCSS or SASS files. You're gonna have a bad time.
|
65
|
+
|
66
|
+
### Configuration
|
58
67
|
|
59
68
|
If you have a compass configuration file (recommended) then you can
|
60
69
|
use the [Compass configuration
|
@@ -64,12 +73,17 @@ files, then you should understand that the compass configuration
|
|
64
73
|
options explained there will be methods and properties on the `config.compass`
|
65
74
|
configuration object exposed to rails within any configuration block.
|
66
75
|
|
67
|
-
|
76
|
+
### Notes On Sprockets Directives
|
77
|
+
|
78
|
+
Sprockets, used by the rails asset pipeline, provides directives for
|
79
|
+
doing things like requiring. These **must not** be used with Sass files.
|
80
|
+
Instead use the sass `@import` directive. In rails projects, the
|
81
|
+
`@import` directive is configured to work with sprockets via `sass-rails`. For more information on importing in rails 3.1 or greater see the [Sass-Rails README](https://github.com/rails/sass-rails/blob/master/README.md)
|
68
82
|
|
69
83
|
### Developing with Rails-based Compilation
|
70
84
|
|
71
85
|
By default, your sass files in `app/assets/stylesheets` will be
|
72
|
-
automatically compiled by the
|
86
|
+
automatically compiled by the [`Sass::Plugin`](http://sass-lang.com/docs/yardoc/Sass/Plugin.html) or the [Rails asset
|
73
87
|
pipeline](http://guides.rubyonrails.org/asset_pipeline.html) depending on the version of rails that you use.
|
74
88
|
|
75
89
|
When using this approach you will need to reload your webpage in order
|
@@ -95,11 +109,7 @@ end
|
|
95
109
|
To return to using the Rails-based compilation mode, simply delete
|
96
110
|
the compiled stylesheets and remove any configuration changes.
|
97
111
|
|
98
|
-
### Compiling for Production
|
99
|
-
|
100
|
-
If using the Rails asset pipeline run:
|
101
|
-
|
102
|
-
$ rake assets:precompile
|
112
|
+
### Compiling for Production without Asset Pipeline
|
103
113
|
|
104
114
|
If not using the asset pipeline run:
|
105
115
|
|
@@ -111,10 +121,7 @@ stylesheets.
|
|
111
121
|
|
112
122
|
### Installing Compass extensions
|
113
123
|
|
114
|
-
Step 1:
|
115
|
-
`:assets` group and run the `bundle` command to install it.
|
116
|
-
If the extension is a zip file, unzip it into the
|
117
|
-
`vendor/plugins/compass_extensions` directory of your project.
|
124
|
+
Step 1: Add it to your Gemfile in the `:assets` group and run the `bundle` command to install it.
|
118
125
|
|
119
126
|
Step 2: Install the extension's assets: `bundle exec compass install
|
120
127
|
<extension/template>`
|
@@ -142,18 +149,9 @@ config.compass.require "susy"
|
|
142
149
|
|
143
150
|
to your application.rb configuration file.
|
144
151
|
|
145
|
-
|
146
|
-
### Notes On Sprockets Directives
|
147
|
-
|
148
|
-
Sprockets, used by the rails asset pipeline, provides directives for
|
149
|
-
doing things like requiring. These **must not** be used with Sass files.
|
150
|
-
Instead use the sass `@import` directive. In rails projects, the
|
151
|
-
`@import` directive is configured to work with sprockets via `sass-rails`. For more information on importing in rails 3.1 or greater see the [Sass-Rails README](https://github.com/rails/sass-rails/blob/master/README.markdown)
|
152
|
-
|
153
152
|
## Rails 3.1 Caveats
|
154
153
|
|
155
|
-
|
156
|
-
at the earliest for this version of rails.
|
154
|
+
compass-rails requires Rails 3.1.1 and greater. Also, Rails 3.1 is out of support so consider upgrading.
|
157
155
|
|
158
156
|
## Rails 3.0 Caveats
|
159
157
|
|
@@ -170,6 +168,22 @@ to this:
|
|
170
168
|
Bundler.require(:default, :assets, Rails.env) if defined?(Bundler)
|
171
169
|
```
|
172
170
|
|
171
|
+
Also, Rails 3.0 is out of support so consider upgrading.
|
172
|
+
|
173
|
+
## Upgrading Rails 3.0 and older projects to compass-rails
|
174
|
+
|
175
|
+
First and foremost, follow the installation instructions above.
|
176
|
+
|
177
|
+
CompassRails uses the rails convention for stylesheet locations even in
|
178
|
+
older versions of rails that do not use the assets pipeline.
|
179
|
+
If you have your stylesheets already in `app/stylesheets`, you have two choices:
|
180
|
+
|
181
|
+
1. Move your stylesheets to `app/assets/stylesheets`.
|
182
|
+
2. Configure your project to look in the **legacy location** of
|
183
|
+
`app/stylesheets` by setting `config.compass.sass_dir =
|
184
|
+
"app/stylesheets"` in your rails configuration or by setting
|
185
|
+
`sass_dir = "app/stylesheets"` in your compass configuration file.
|
186
|
+
|
173
187
|
## Contributing
|
174
188
|
|
175
189
|
1. Fork it
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
version: 1.1.0
|
4
|
+
prerelease:
|
5
|
+
version: 1.1.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Scott Davis
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-12-
|
13
|
+
date: 2013-12-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -103,9 +103,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
103
|
none: false
|
104
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
|
-
- - ! '
|
106
|
+
- - ! '>='
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version:
|
108
|
+
version: '0'
|
109
109
|
none: false
|
110
110
|
requirements: []
|
111
111
|
rubyforge_project:
|