Sha256: 0f6c5a11df8b25596300504c1c5d57ae5f370111df544337bbbbbe7126c2e84d

Contents?: true

Size: 1.26 KB

Versions: 78

Compression:

Stored size: 1.26 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 = { }
    params[:browsers] = opts.delete(:browsers) if opts.has_key?(:browsers)
    params[:cascade]  = opts.delete(:cascade)  if opts.has_key?(:cascade)
    params[:remove]   = opts.delete(:remove)   if opts.has_key?(:remove)
    params[:env]      = opts.delete(:env)      if opts.has_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

78 entries across 78 versions & 2 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/autoprefixer-rails-9.4.8/lib/autoprefixer-rails.rb
autoprefixer-rails-9.4.9 lib/autoprefixer-rails.rb
autoprefixer-rails-9.4.8 lib/autoprefixer-rails.rb
autoprefixer-rails-9.4.7 lib/autoprefixer-rails.rb
autoprefixer-rails-9.4.6 lib/autoprefixer-rails.rb
autoprefixer-rails-9.4.5 lib/autoprefixer-rails.rb
autoprefixer-rails-9.4.4 lib/autoprefixer-rails.rb
autoprefixer-rails-9.4.3 lib/autoprefixer-rails.rb
autoprefixer-rails-9.4.2 lib/autoprefixer-rails.rb
autoprefixer-rails-9.4.1 lib/autoprefixer-rails.rb
autoprefixer-rails-9.4.0 lib/autoprefixer-rails.rb
autoprefixer-rails-9.3.1 lib/autoprefixer-rails.rb
autoprefixer-rails-9.3.0 lib/autoprefixer-rails.rb
autoprefixer-rails-9.2.1 lib/autoprefixer-rails.rb
autoprefixer-rails-9.2.0 lib/autoprefixer-rails.rb
autoprefixer-rails-9.1.4 lib/autoprefixer-rails.rb
autoprefixer-rails-9.1.3 lib/autoprefixer-rails.rb
autoprefixer-rails-9.1.2 lib/autoprefixer-rails.rb
autoprefixer-rails-9.1.1 lib/autoprefixer-rails.rb
autoprefixer-rails-9.1.0 lib/autoprefixer-rails.rb