Module: Evax::CssMinifier
- Defined in:
- lib/evax/css_minifier.rb
Overview
Class Method Summary collapse
Class Method Details
.build(css_string) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/evax/css_minifier.rb', line 5 def self.build(css_string) css_string.gsub!(/\n/," ") css_string.gsub!(/\/\*.*?\*\//m,"") css_string.gsub!(/\s*:\s*/, ":") css_string.gsub!(/\s*;\s*/, ";") css_string.gsub!(/\s*,\s*/, ",") css_string.gsub!(/\s*\{\s*/, "{") css_string.gsub!(/\s\s+/, " ") css_string.gsub!(/^\s*/, "") css_string.gsub!(/\s!important/, "!important") css_string.gsub!(/;\s*\}\s*/, "}") end |