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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 402538c8bd48ed82f5bc5d8cb61c86786dc22b6f
4
- data.tar.gz: 482d0d2242a5aa9e038ede8c3c34feb4026e3911
3
+ metadata.gz: a205a5b3fd503b4bb4ada1049cec4b430829709d
4
+ data.tar.gz: 2c20a42dde168003bfce6b4b702668bff2866902
5
5
  SHA512:
6
- metadata.gz: cafa801abc257eb55cd19b3352ef75391a17cf47d2b5809d3fe66a06e3b909ce129c6b2f0ffe5016dc6e185fcba2deaaf2ecda70ae752f0ab02021ded037fbfe
7
- data.tar.gz: a314e79a9005b6eca58a71f12f06ec92c5336f2bbb3528a7d3826de6eaa161ade11c0f50006e6fa085cebd418d55f6103787d7aea1a476a5e00ba43c9e8fac7f
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
- ### Getting started
5
+ ## Getting started
6
6
 
7
- From the command line:
7
+ ### Installing in a Rails project
8
8
 
9
- `gem install sass-chameleon`
9
+ Add to your Gemfile:
10
10
 
11
+ `gem 'chameleon-sass'`
11
12
 
12
- In your Sass project:
13
+ Add to your main Sass stylesheet:
13
14
 
14
15
  `@import "chameleon";`
15
16
 
16
17
 
17
- Generate some responsive grid classes:
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();
@@ -0,0 +1,3 @@
1
+ =tester($x)
2
+ body:before
3
+ content: $x + test
@@ -1,43 +1,47 @@
1
1
  module ChameleonSass
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  DATE = "2014-08-12"
4
4
 
5
5
  class << self
6
6
 
7
7
  def load
8
- if compass?
9
- register_compass
10
- elsif sass?
11
- add_sass_load_path
12
- else
13
- add_sass_load_path_to_env
14
- end
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 gem_path
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(gem_path, 'assets')
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? ::Compass
34
+ return :compass if defined?(::Compass)
31
35
  end
32
36
 
33
37
  def sass?
34
- defined? ::Sass
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 => gem_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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chameleon-sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Grant