compass-config 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,46 @@
1
+ # compass-config
2
+
3
+ A [Compass](http://compass-style.org/) plugin for accessing the
4
+ [Compass configuration properties](http://compass-style.org/help/tutorials/configuration-reference/#configuration-properties) inside your scss/sass files.
5
+
6
+ ## Installation
7
+
8
+ ```bash
9
+ gem install compass-config
10
+ ```
11
+
12
+ To load the plugin, simply require it at the top of your configuration file:
13
+
14
+ ```ruby
15
+ require 'compass-config'
16
+ ```
17
+
18
+ Next, import the `_compass-config.scss` partial into your stylesheets:
19
+
20
+ ```sass
21
+ @import 'compass-config';
22
+ ```
23
+
24
+ ## Example usage
25
+
26
+ This plugins registers a function, `x-config`, which allows you to fetch any of
27
+ the Compass configuration properties. It accepts the property name as a single
28
+ parameter and returns a string representation of its corresponding value.
29
+
30
+ e.g.:
31
+
32
+ ```sass
33
+ $environment: x-config('environment');
34
+
35
+ @if $environment == 'development' {
36
+ // development only styles
37
+ }
38
+ ```
39
+
40
+ ## Contributing
41
+
42
+ 1. Fork it
43
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
44
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
45
+ 4. Push to the branch (`git push origin my-new-feature`)
46
+ 5. Create new Pull Request
@@ -0,0 +1,16 @@
1
+ # List required gems
2
+ require "compass"
3
+
4
+ # Register extension and provide location
5
+ extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
6
+ Compass::Frameworks.register("compass-config", :path => extension_path)
7
+
8
+ # Custom SassScript
9
+ module Sass::Script::Functions
10
+ def x_compass_config(property)
11
+ property = property.value
12
+ property = Compass.configuration.read(property)
13
+ property = property.to_s
14
+ return Sass::Script::String.new(property)
15
+ end
16
+ end
@@ -0,0 +1,6 @@
1
+ // @param {string} $property
2
+ // @return {string}
3
+ // @api public
4
+ @function x-config($property) {
5
+ @return x_compass_config($property);
6
+ }
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: compass-config
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Steven Benisek
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-01-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: sass
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 3.2.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: compass
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 0.12.1
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 0.12.1
46
+ description: A Compass plugin for accessing the Compass configuration properties inside
47
+ scss|sass files
48
+ email:
49
+ - steven.benisek@gmail.com
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - README.md
55
+ - lib/compass-config.rb
56
+ - stylesheets/_compass-config.scss
57
+ homepage: https://github.com/stevenbenisek/compass-config
58
+ licenses:
59
+ - MIT
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 1.8.25
79
+ signing_key:
80
+ specification_version: 3
81
+ summary: A Compass plugin for accessing the Compass configuration properties inside
82
+ scss|sass files
83
+ test_files: []