Class: Sass::Supports::Declaration
- Defined in:
- lib/sass/supports.rb
Overview
A declaration condition (e.g. (feature: value)
).
Instance Attribute Summary collapse
-
#name
The feature name.
-
#resolved_name ⇒ String
The name of the feature after any SassScript has been resolved.
-
#resolved_value ⇒ String
The value of the feature after any SassScript has been resolved.
-
#value
The feature value.
Instance Method Summary collapse
- #deep_copy
-
#initialize(name, value) ⇒ Declaration
constructor
A new instance of Declaration.
- #options=(options)
- #perform(env)
- #to_css
- #to_src(options)
Constructor Details
#initialize(name, value) ⇒ Declaration
Returns a new instance of Declaration.
158 159 160 161 |
# File 'lib/sass/supports.rb', line 158
def initialize(name, value)
@name = name
@value = value
end
|
Instance Attribute Details
#name
The feature name.
139 140 141 |
# File 'lib/sass/supports.rb', line 139
def name
@name
end
|
#resolved_name ⇒ String
The name of the feature after any SassScript has been resolved. Only set once Tree::Visitors::Perform has been run.
145 146 147 |
# File 'lib/sass/supports.rb', line 145
def resolved_name
@resolved_name
end
|
#resolved_value ⇒ String
The value of the feature after any SassScript has been resolved. Only set once Tree::Visitors::Perform has been run.
156 157 158 |
# File 'lib/sass/supports.rb', line 156
def resolved_value
@resolved_value
end
|
#value
The feature value.
150 151 152 |
# File 'lib/sass/supports.rb', line 150
def value
@value
end
|
Instance Method Details
#deep_copy
176 177 178 179 180 181 |
# File 'lib/sass/supports.rb', line 176
def deep_copy
copy = dup
copy.name = @name.deep_copy
copy.value = @value.deep_copy
copy
end
|
#options=(options)
183 184 185 186 |
# File 'lib/sass/supports.rb', line 183
def options=(options)
@name.options = options
@value.options = options
end
|
#perform(env)
163 164 165 166 |
# File 'lib/sass/supports.rb', line 163
def perform(env)
@resolved_name = name.perform(env)
@resolved_value = value.perform(env)
end
|
#to_css
168 169 170 |
# File 'lib/sass/supports.rb', line 168
def to_css
"(#{@resolved_name}: #{@resolved_value})"
end
|
#to_src(options)
172 173 174 |
# File 'lib/sass/supports.rb', line 172
def to_src(options)
"(#{@name.to_sass(options)}: #{@value.to_sass(options)})"
end
|