I am looking for a css minifier that I could use in rails apps (not gziper) which doesn't need a command line YUI compressor instalation. I am working on a content mangament software where the css is pasted into a textarea and then I want to minify then gzip and send it to amazon. So those solutions are not OK which use some command line preprocessing... Any ideas?
Online minifier services are also welcome.
You could also try SASS with :syntax => :scss, :style => :compressed
.
I think I have found my gem:
'ruby-yui-compressor'
All I need to do:
gem "yui-compressor", "~> 0.9.6", :require => "yui/compressor"
....
compressor = YUI::CssCompressor.new
compressor.compress 'body {line-height: 1} \ntable {border-collapse: collapse; border-spacing: 0}'
=> "body{line-height:1}\\ntable{border-collapse:collapse;border-spacing:0}"
How about Juicer?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With