Module: CssMedia
- Defined in:
- lib/css_media.rb,
lib/css_media/result.rb,
lib/css_media/version.rb,
lib/css_media/processor.rb,
lib/css_media/sprockets.rb
Defined Under Namespace
Classes: Processor, Result, Sprockets
Constant Summary collapse
- VERSION =
"0.2.0"
Class Method Summary collapse
-
.install(assets, opts = {}) ⇒ Object
Add Autoprefixer for Sprockets environment in ‘assets`.
-
.process(css, opts = { }) ⇒ Object
Add prefixes to ‘css`.
-
.uninstall(assets) ⇒ Object
Disable installed Autoprefixer.
Class Method Details
.install(assets, opts = {}) ⇒ Object
Add Autoprefixer for Sprockets environment in ‘assets`. You can specify `browsers` actual in your project.
15 16 17 18 |
# File 'lib/css_media.rb', line 15 def self.install(assets, opts = {}) Sprockets.register_processor(Processor.new(opts)) Sprockets.install(assets) end |
.process(css, opts = { }) ⇒ Object
Add prefixes to ‘css`. See `Processor#process` for options.
7 8 9 10 11 |
# File 'lib/css_media.rb', line 7 def self.process(css, opts = { }) params = { } # params[:browsers] = opts.delete(:browsers) if opts.has_key?(:browsers) Processor.new(params).process(css, opts) end |