chameleon-sass 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +42 -5
- data/assets/stylesheets/_chameleon.sass +3 -0
- data/lib/chameleon-sass.rb +20 -14
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a205a5b3fd503b4bb4ada1049cec4b430829709d
|
4
|
+
data.tar.gz: 2c20a42dde168003bfce6b4b702668bff2866902
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89a501fc3b0614eb78803df1e3c5739d894d1813c680581e6a097cea0c7a2c3428e8c30206f8e30b1cbe69adf6012b12a0a57f1fdd34ba3a2302e59ab05518c7
|
7
|
+
data.tar.gz: 52e773a7d067d102d9b59643765dfa3e43aa2aca54873d47270ecb37da9464f0d5fa0e80a5a93ab48e0c42c167c375463e01e21b1a42b2d000a686b2bd64260a
|
data/README.md
CHANGED
@@ -2,19 +2,56 @@ Chameleon
|
|
2
2
|
=========
|
3
3
|
|
4
4
|
|
5
|
-
|
5
|
+
## Getting started
|
6
6
|
|
7
|
-
|
7
|
+
### Installing in a Rails project
|
8
8
|
|
9
|
-
|
9
|
+
Add to your Gemfile:
|
10
10
|
|
11
|
+
`gem 'chameleon-sass'`
|
11
12
|
|
12
|
-
|
13
|
+
Add to your main Sass stylesheet:
|
13
14
|
|
14
15
|
`@import "chameleon";`
|
15
16
|
|
16
17
|
|
17
|
-
|
18
|
+
### Installing in a Compass project
|
19
|
+
|
20
|
+
From the command line:
|
21
|
+
|
22
|
+
`gem install chameleon-sass`
|
23
|
+
|
24
|
+
Add to the top of your Compass config file (usually config.rb):
|
25
|
+
|
26
|
+
`require 'chameleon-sass'`
|
27
|
+
|
28
|
+
Add to your main Sass stylesheet:
|
29
|
+
|
30
|
+
`@import "chameleon"`
|
31
|
+
|
32
|
+
|
33
|
+
### Installing in a Bower project
|
34
|
+
|
35
|
+
From the command line:
|
36
|
+
|
37
|
+
`bower install chameleon-sass`
|
38
|
+
|
39
|
+
If you are using Compass you can add the import path to your Compass config file (usually config.rb):
|
40
|
+
|
41
|
+
`add_import_path "bower_components/chameleon-sass/assets/stylesheets/"`
|
42
|
+
|
43
|
+
Otherwise, you will need to manually add the above path to your @import.
|
44
|
+
|
45
|
+
Add to your main Sass stylesheet:
|
46
|
+
|
47
|
+
`@import "chameleon"`
|
48
|
+
|
49
|
+
|
50
|
+
### Generating a responsive grid
|
51
|
+
|
52
|
+
One of the defining feature of Chameleon is that no CSS is generated until you explictly declare the generation of some classes.
|
53
|
+
|
54
|
+
Let's get started by adding some building blocks of a responsive grid:
|
18
55
|
|
19
56
|
```
|
20
57
|
@include grid-defaults();
|
data/lib/chameleon-sass.rb
CHANGED
@@ -1,43 +1,47 @@
|
|
1
1
|
module ChameleonSass
|
2
|
-
VERSION = "0.0.
|
2
|
+
VERSION = "0.0.3"
|
3
3
|
DATE = "2014-08-12"
|
4
4
|
|
5
5
|
class << self
|
6
6
|
|
7
7
|
def load
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
methods = {
|
9
|
+
sass: 'add_sass_load_path',
|
10
|
+
compass: 'register_compass',
|
11
|
+
none: 'add_sass_load_path_to_env'
|
12
|
+
}
|
13
|
+
|
14
|
+
self.send(methods[defined_framework])
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
17
|
+
def project_path
|
18
18
|
File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
19
19
|
end
|
20
20
|
|
21
21
|
def assets_path
|
22
|
-
File.join(
|
22
|
+
File.join(project_path, 'assets')
|
23
23
|
end
|
24
24
|
|
25
25
|
def stylesheets_path
|
26
26
|
File.join(assets_path, 'stylesheets')
|
27
27
|
end
|
28
28
|
|
29
|
+
def defined_framework
|
30
|
+
compass? || sass? || :none
|
31
|
+
end
|
32
|
+
|
29
33
|
def compass?
|
30
|
-
defined?
|
34
|
+
return :compass if defined?(::Compass)
|
31
35
|
end
|
32
36
|
|
33
37
|
def sass?
|
34
|
-
defined?
|
38
|
+
return :sass if defined?(::Sass)
|
35
39
|
end
|
36
40
|
|
37
41
|
def register_compass
|
38
42
|
::Compass::Frameworks.register(
|
39
43
|
'chameleon-sass',
|
40
|
-
:path =>
|
44
|
+
:path => project_path,
|
41
45
|
:stylesheets_directory => stylesheets_path
|
42
46
|
)
|
43
47
|
end
|
@@ -54,4 +58,6 @@ module ChameleonSass
|
|
54
58
|
end
|
55
59
|
|
56
60
|
end
|
57
|
-
end
|
61
|
+
end
|
62
|
+
|
63
|
+
ChameleonSass.load
|