Sha256: f052499b837dd009b4b66940d09992bed887ced37c3652de2a33251cfc30c3ff

Contents?: true

Size: 1.36 KB

Versions: 45

Compression:

Stored size: 1.36 KB

Contents

# Ruby integration with Autoprefixer JS library, which parse CSS and adds
# only actual prefixed
module AutoprefixerRails
  autoload :Sprockets, "autoprefixer-rails/sprockets"

  # Add prefixes to `css`. See `Processor#process` for options.
  def self.process(css, opts = {})
    params = {}
    if opts.key?(:overrideBrowserslist)
      params[:overrideBrowserslist] = opts.delete(:overrideBrowserslist)
    end
    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

  # Add Autoprefixer for Sprockets environment in `assets`.
  # You can specify `browsers` actual in your project.
  def self.install(assets, params = {})
    Sprockets.register_processor(processor(params))
    Sprockets.install(assets)
  end

  # Disable installed Autoprefixer
  def self.uninstall(assets)
    Sprockets.uninstall(assets)
  end

  # Cache processor instances
  def self.processor(params = {})
    Processor.new(params)
  end
end

require_relative "autoprefixer-rails/result"
require_relative "autoprefixer-rails/version"
require_relative "autoprefixer-rails/processor"

require_relative "autoprefixer-rails/railtie" if defined?(Rails)

Version data entries

45 entries across 30 versions & 2 rubygems

Version Path
autoprefixer-rails-9.8.6 lib/autoprefixer-rails.rb
autoprefixer-rails-9.8.5 lib/autoprefixer-rails.rb
autoprefixer-rails-9.8.4 lib/autoprefixer-rails.rb
autoprefixer-rails-9.8.3 lib/autoprefixer-rails.rb
autoprefixer-rails-9.8.2 lib/autoprefixer-rails.rb
autoprefixer-rails-9.8.1 lib/autoprefixer-rails.rb
autoprefixer-rails-9.7.6 lib/autoprefixer-rails.rb
autoprefixer-rails-9.7.5 lib/autoprefixer-rails.rb
autoprefixer-rails-9.7.4 lib/autoprefixer-rails.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.7.1/lib/autoprefixer-rails.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.1/lib/autoprefixer-rails.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.7.3/lib/autoprefixer-rails.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.4/lib/autoprefixer-rails.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.5/lib/autoprefixer-rails.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.1.1/lib/autoprefixer-rails.rb
autoprefixer-rails-9.7.3 lib/autoprefixer-rails.rb
autoprefixer-rails-9.7.2 lib/autoprefixer-rails.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.1.1/lib/autoprefixer-rails.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.1/lib/autoprefixer-rails.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/autoprefixer-rails-9.6.4/lib/autoprefixer-rails.rb