Class: Sass::Tree::Visitors::ToCss
- Inherits:
-
Base
- Object
- Base
- Sass::Tree::Visitors::ToCss
- Defined in:
- lib/sassmagic/reset.rb
Overview
重写属性解析to_css.rb A visitor for converting a Sass tree into CSS.
Instance Attribute Summary collapse
-
#source_mapping ⇒ Object
readonly
The source mapping for the generated CSS file.
Instance Method Summary collapse
-
#initialize(build_source_mapping = false) ⇒ ToCss
constructor
A new instance of ToCss.
-
#visit(node) ⇒ String
Runs the visitor on ‘node`.
Constructor Details
#initialize(build_source_mapping = false) ⇒ ToCss
Returns a new instance of ToCss.
205 206 207 208 209 210 211 |
# File 'lib/sassmagic/reset.rb', line 205 def initialize(build_source_mapping = false) @tabs = 0 @line = 1 @offset = 1 @result = "" @source_mapping = Sass::Source::Map.new if build_source_mapping end |
Instance Attribute Details
#source_mapping ⇒ Object (readonly)
The source mapping for the generated CSS file. This is only set if ‘build_source_mapping` is passed to the constructor and Engine#render has been run.
200 201 202 |
# File 'lib/sassmagic/reset.rb', line 200 def source_mapping @source_mapping end |
Instance Method Details
#visit(node) ⇒ String
Runs the visitor on ‘node`.
217 218 219 220 221 222 |
# File 'lib/sassmagic/reset.rb', line 217 def visit(node) super rescue Sass::SyntaxError => e e.modify_backtrace(:filename => node.filename, :line => node.line) raise e end |