|
|
require 'compass/import-once/activate'
|
|
|
|
|
|
# autoprefixer自动加浏览器前缀
|
|
|
# 需要先安装, gem install autoprefixer-rails
|
|
|
|
|
|
# require 'autoprefixer-rails'
|
|
|
#
|
|
|
# on_stylesheet_saved do |file|
|
|
|
# css = File.read(file)
|
|
|
# map = file + '.map'
|
|
|
# browsers = ['> 1%', 'ie 8']
|
|
|
#
|
|
|
# if File.exists? map
|
|
|
# result = AutoprefixerRails.process(css,
|
|
|
# from: file,
|
|
|
# to: file,
|
|
|
# browsers: browsers,
|
|
|
# map: { prev: File.read(map), inline: false })
|
|
|
# File.open(file, 'w') { |io| io << result.css }
|
|
|
# File.open(map, 'w') { |io| io << result.map }
|
|
|
# else
|
|
|
# File.open(file, 'w') { |io| io << AutoprefixerRails.process(css, browsers) }
|
|
|
# end
|
|
|
# end
|
|
|
|
|
|
# Require any additional compass plugins here.
|
|
|
|
|
|
# Set this to the root of your project when deployed:
|
...
|
...
|
|