Created
July 1, 2013 16:01
-
-
Save daphotron/5902134 to your computer and use it in GitHub Desktop.
Remove last semi-colon within compressed CSS files generated by SASS, place this inside your config.rb.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Removes the last semi-colon in the CSS block | |
| def cleansemi(filepath) | |
| # puts "cleaning: #{filepath}" | |
| text = File.read(filepath) | |
| replace = text.gsub(/;(.\s*)\}/m, '\1}') | |
| # puts replace | |
| File.open(filepath, "w") {|file| file.puts replace} | |
| end | |
| # Clean semi-colons with the stylesheet callbacks | |
| on_stylesheet_saved do |filepath| | |
| # puts "about to clean: #{filepath}" | |
| cleansemi(filepath) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment