Module: AutoprefixerRails
- Defined in:
- lib/autoprefixer-rails.rb,
lib/autoprefixer-rails/result.rb,
lib/autoprefixer-rails/version.rb,
lib/autoprefixer-rails/processor.rb,
lib/autoprefixer-rails/sprockets.rb
Overview
:nodoc:
Defined Under Namespace
Classes: Processor, Result, Sprockets
Constant Summary collapse
- VERSION =
"10.4.19.0"
- IS_SECTION =
/^\s*\[(.+)\]\s*$/.freeze
Class Method Summary collapse
-
.install(assets, params = {}) ⇒ Object
Add Autoprefixer for Sprockets environment in ‘assets`.
-
.process(css, opts = {}) ⇒ Object
Add prefixes to ‘css`.
-
.processor(params = {}) ⇒ Object
Cache processor instances.
-
.uninstall(assets) ⇒ Object
Disable installed Autoprefixer.
Class Method Details
.install(assets, params = {}) ⇒ Object
Add Autoprefixer for Sprockets environment in ‘assets`. You can specify `browsers` actual in your project.
21 22 23 24 |
# File 'lib/autoprefixer-rails.rb', line 21 def self.install(assets, params = {}) Sprockets.register_processor(processor(params)) Sprockets.install(assets) end |
.process(css, opts = {}) ⇒ Object
Add prefixes to ‘css`. See `Processor#process` for options.
9 10 11 12 13 14 15 16 17 |
# File 'lib/autoprefixer-rails.rb', line 9 def self.process(css, opts = {}) params = {} params[:overrideBrowserslist] = opts.delete(:overrideBrowserslist) if opts.key?(:overrideBrowserslist) params[:browsers] = opts.delete(:browsers) if opts.key?(:browsers) params[:cascade] = opts.delete(:cascade) if opts.key?(:cascade) params[:remove] = opts.delete(:remove) if opts.key?(:remove) params[:env] = opts.delete(:env) if opts.key?(:env) processor(params).process(css, opts) end |