0

I've followed the answer from this thread: https://stackoverflow.com/a/15625461/7429535

This has worked, in that it stops all css files from being minified.

Would it be possible to only do this for a single css file?

Thanks in advance

Daniel Lawton
  • 416
  • 3
  • 9
  • 30

1 Answers1

0

You could add a comment at the top of the CSS file and check for it:

Modified version from the other answer:

create a module that does nothing to compress js / css here: lib/modules/no_compression.rb

class NoCompression
  def compress(string)
    if string.starts_with?("/* nocompress */")
      string
    else
      compressor = YUI::CssCompressor.new
      compressor.compress(string)
    end
  end
end

and add the comment /* nocompress */ to the top of your CSS file

NM Pennypacker
  • 6,704
  • 11
  • 36
  • 38