Skip to content

Instantly share code, notes, and snippets.

@takustaqu
Last active September 2, 2015 03:44
Show Gist options
  • Save takustaqu/7c0597db56bae1863454 to your computer and use it in GitHub Desktop.
Save takustaqu/7c0597db56bae1863454 to your computer and use it in GitHub Desktop.
Compassに於けるAutoprefixerの使い方

Compass + Autoprefixer-rails

以下のgemが必要

  • autoprefixer-rails
  • csso-rails

以下のコマンドをCLIで叩いて環境にインストール

$sudo gem install autoprefixer-rails
$sudo gem install csso-rails

compassプロジェクトのcomfig.rbに以下を追記

require 'autoprefixer-rails'
require 'csso'

on_stylesheet_saved do |file|
  css = File.read(file)
  File.open(file, 'w') do |io|
    io << AutoprefixerRails.process(css)
  end
end

あとは普通にcompass wすればOK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment