Sha256: 5a99e3e0f57277cda514d501589808bc6779ec50bb068a4b9199f333f56e2e5d

Contents?: true

Size: 1.04 KB

Versions: 7

Compression:

Stored size: 1.04 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 = { })
    browsers = opts.delete(:browsers)
    processor(browsers).process(css, opts)
  end

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

  # Cache processor instances
  def self.processor(browsers=nil)
    @cache ||= { }
    @cache[browsers] ||= Processor.new(browsers)
  end

  # Deprecated method. Use `process` instead.
  def self.compile(css, browsers = nil)
    processor(browsers).compile(css)
  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

7 entries across 7 versions & 1 rubygems

Version Path
autoprefixer-rails-1.0.20140213 lib/autoprefixer-rails.rb
autoprefixer-rails-1.0.20140203 lib/autoprefixer-rails.rb
autoprefixer-rails-1.0.20140130 lib/autoprefixer-rails.rb
autoprefixer-rails-1.0.20140117 lib/autoprefixer-rails.rb
autoprefixer-rails-1.0.20140110 lib/autoprefixer-rails.rb
autoprefixer-rails-1.0.20140109 lib/autoprefixer-rails.rb
autoprefixer-rails-1.0.20140103 lib/autoprefixer-rails.rb