Class: Jammit::SassCompressor
- Inherits:
-
Object
- Object
- Jammit::SassCompressor
- Defined in:
- lib/jammit/sass_compressor.rb
Overview
Wraps sass’ css compressor to use the same API as the rest of Jammit’s compressors.
Instance Method Summary collapse
-
#compress(css) ⇒ Object
Compresses
css
using sass’ CSS parser, and returns the compressed css. -
#initialize(options = {}) ⇒ SassCompressor
constructor
Creates a new sass compressor.
Constructor Details
#initialize(options = {}) ⇒ SassCompressor
Creates a new sass compressor. Jammit::SassCompressor doesn’t use any options, the options
parameter is there for API compatibility.
7 8 |
# File 'lib/jammit/sass_compressor.rb', line 7 def initialize( = {}) end |
Instance Method Details
#compress(css) ⇒ Object
Compresses css
using sass’ CSS parser, and returns the compressed css.
12 13 14 15 16 |
# File 'lib/jammit/sass_compressor.rb', line 12 def compress(css) root_node = ::Sass::SCSS::CssParser.new(css, 'test.sass').parse root_node. = {:style => :compressed} root_node.render.strip end |