0

I'd like to output / compile CSS for multiple browsers with Compass and Autoprefixer, but using different settings for each file. E.g.

chrome.css Chrome > 4

firefox.css Firefox > 20

safari.css Safari > 6

And so on.

The reason for this is to serve specific stylesheets for each browser.

Here are my current standard Compass config.rb settings, the same Autoprefixer settings for each style sheet that is compiled:

# Autofixer Settings
require 'autoprefixer-rails'
on_stylesheet_saved do |file|
  css = File.read(file)
  File.open(file, 'w') do |io|
    io << AutoprefixerRails.process(css, browsers: ["last 20 versions"])
  end
end
David B
  • 54
  • 4
  • 1
    **"The reason for this is to serve specific stylesheets for each browser."**...this sounds like a very poor idea. – Paulie_D Mar 06 '15 at 12:30
  • 1
    The amount of bytes you're saving by doing this is negligible, plus it requires extra overhead by adding a JavaScript requirement. I don't see a good reason to do this at all. – cimmanon Mar 06 '15 at 12:33
  • Why serve -moz prefixes to Chrome? I currently separate my Explorer hacks, and this works fine. It's the same thing. – David B Mar 06 '15 at 12:39

0 Answers0