Sha256: 91d52964f69ee9c60c790a6904c40993d55b2d98fd4cfadfd4add1e2e01cb5fc

Contents?: true

Size: 1.19 KB

Versions: 22

Compression:

Stored size: 1.19 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)
    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

22 entries across 22 versions & 1 rubygems

Version Path
autoprefixer-rails-6.5.4 lib/autoprefixer-rails.rb
autoprefixer-rails-6.5.3.1 lib/autoprefixer-rails.rb
autoprefixer-rails-6.5.3 lib/autoprefixer-rails.rb
autoprefixer-rails-6.5.2 lib/autoprefixer-rails.rb
autoprefixer-rails-6.5.1.1 lib/autoprefixer-rails.rb
autoprefixer-rails-6.5.1 lib/autoprefixer-rails.rb
autoprefixer-rails-6.5.0.2 lib/autoprefixer-rails.rb
autoprefixer-rails-6.5.0.1 lib/autoprefixer-rails.rb
autoprefixer-rails-6.5.0 lib/autoprefixer-rails.rb
autoprefixer-rails-6.4.1.1 lib/autoprefixer-rails.rb
autoprefixer-rails-6.4.1 lib/autoprefixer-rails.rb
autoprefixer-rails-6.4.0.3 lib/autoprefixer-rails.rb
autoprefixer-rails-6.4.0.2 lib/autoprefixer-rails.rb
autoprefixer-rails-6.4.0.1 lib/autoprefixer-rails.rb
autoprefixer-rails-6.4.0 lib/autoprefixer-rails.rb
autoprefixer-rails-6.3.7 lib/autoprefixer-rails.rb
autoprefixer-rails-6.3.6.2 lib/autoprefixer-rails.rb
autoprefixer-rails-6.3.6.1 lib/autoprefixer-rails.rb
autoprefixer-rails-6.3.6 lib/autoprefixer-rails.rb
autoprefixer-rails-6.3.5 lib/autoprefixer-rails.rb