sass-utilities 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -0
- data/lib/sass-utilities.rb +43 -0
- metadata +101 -0
data/README.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
Sass Utilities
|
2
|
+
==============
|
3
|
+
|
4
|
+
Compass plugin with various Sass script utility functions. Includes
|
5
|
+
|
6
|
+
* Functions to test if a variable, mixing and function exists
|
7
|
+
* Variable interpolation
|
8
|
+
|
9
|
+
### Coming (maybe!)
|
10
|
+
|
11
|
+
* Function and mixin interpolation - hopefully https://github.com/nex3/sass/issues/626 gets into Sass soon so an extension doesn't have to worry about it.
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'compass'
|
2
|
+
|
3
|
+
extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
|
4
|
+
Compass::Frameworks.register('sass-utilities', :path => extension_path)
|
5
|
+
|
6
|
+
module SassUtilities
|
7
|
+
VERSION = "1.0"
|
8
|
+
DATE = "2013-03-03"
|
9
|
+
end
|
10
|
+
|
11
|
+
module Sass::Script::Functions
|
12
|
+
|
13
|
+
# Exists
|
14
|
+
def variable_exists(variable_name)
|
15
|
+
if(environment.var(variable_name.value))
|
16
|
+
Sass::Script::Bool.new(true)
|
17
|
+
else
|
18
|
+
Sass::Script::Bool.new(false)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def mixin_exists(mixin_name)
|
23
|
+
if(environment.mixin(mixin_name.value))
|
24
|
+
Sass::Script::Bool.new(true)
|
25
|
+
else
|
26
|
+
Sass::Script::Bool.new(false)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def function_exists(function_name)
|
31
|
+
if(environment.function(function_name.value))
|
32
|
+
Sass::Script::Bool.new(true)
|
33
|
+
else
|
34
|
+
Sass::Script::Bool.new(false)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# Interpolate
|
39
|
+
def interpolate_variable(variable_name)
|
40
|
+
environment.var(variable_name.value) || Sass::Script::Bool.new(false)
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sass-utilities
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 15
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
version: "1.0"
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Edward O'Riordan
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2013-03-03 00:00:00 Z
|
18
|
+
dependencies:
|
19
|
+
- !ruby/object:Gem::Dependency
|
20
|
+
name: sass
|
21
|
+
prerelease: false
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: -1232310454
|
28
|
+
segments:
|
29
|
+
- 3
|
30
|
+
- 3
|
31
|
+
- 0
|
32
|
+
- alpha
|
33
|
+
- 93
|
34
|
+
version: 3.3.0.alpha.93
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: compass
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 45
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
- 12
|
49
|
+
- 1
|
50
|
+
version: 0.12.1
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
description: Various Sass script utility functions. Includes tests for existence and variable interpolation
|
54
|
+
email:
|
55
|
+
- hello@edwardoriordan.com
|
56
|
+
executables: []
|
57
|
+
|
58
|
+
extensions: []
|
59
|
+
|
60
|
+
extra_rdoc_files: []
|
61
|
+
|
62
|
+
files:
|
63
|
+
- README.md
|
64
|
+
- lib/sass-utilities.rb
|
65
|
+
homepage: https://github.com/edwardoriordan/sass-utilities
|
66
|
+
licenses: []
|
67
|
+
|
68
|
+
post_install_message:
|
69
|
+
rdoc_options: []
|
70
|
+
|
71
|
+
require_paths:
|
72
|
+
- lib
|
73
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
hash: 3
|
79
|
+
segments:
|
80
|
+
- 0
|
81
|
+
version: "0"
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
hash: 23
|
88
|
+
segments:
|
89
|
+
- 1
|
90
|
+
- 3
|
91
|
+
- 6
|
92
|
+
version: 1.3.6
|
93
|
+
requirements: []
|
94
|
+
|
95
|
+
rubyforge_project:
|
96
|
+
rubygems_version: 1.8.24
|
97
|
+
signing_key:
|
98
|
+
specification_version: 3
|
99
|
+
summary: Various Sass script utility functions. Includes tests for existence and variable interpolation. Hopefully things that can be in the future done in Sass or added to Compass
|
100
|
+
test_files: []
|
101
|
+
|