Class: Sass::Tree::Visitors::ToCss
- Inherits:
-
Base
- Object
- Base
- Sass::Tree::Visitors::ToCss
- Defined in:
- .ruby-sass/lib/sass/tree/visitors/to_css.rb
Overview
A visitor for converting a Sass tree into CSS.
Constant Summary
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`.
Methods inherited from Base
Constructor Details
#initialize(build_source_mapping = false) ⇒ ToCss
Returns a new instance of ToCss
11 12 13 14 15 16 17 18 19 |
# File '.ruby-sass/lib/sass/tree/visitors/to_css.rb', line 11 def initialize(build_source_mapping = false) @tabs = 0 @line = 1 @offset = 1 @result = String.new("") @source_mapping = build_source_mapping ? Sass::Source::Map.new : nil @lstrip = nil @in_directive = false end |
Constructor Details
#initialize(build_source_mapping = false) ⇒ ToCss
Returns a new instance of ToCss
11 12 13 14 15 16 17 18 19 |
# File '.ruby-sass/lib/sass/tree/visitors/to_css.rb', line 11 def initialize(build_source_mapping = false) @tabs = 0 @line = 1 @offset = 1 @result = String.new("") @source_mapping = build_source_mapping ? Sass::Source::Map.new : nil @lstrip = nil @in_directive = false 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.
6 7 8 |
# File '.ruby-sass/lib/sass/tree/visitors/to_css.rb', line 6 def source_mapping @source_mapping end |
Instance Method Details
#visit(node) ⇒ String
Runs the visitor on `node`.
25 26 27 28 29 30 |
# File '.ruby-sass/lib/sass/tree/visitors/to_css.rb', line 25 def visit(node) super rescue Sass::SyntaxError => e e.modify_backtrace(:filename => node.filename, :line => node.line) raise e end |