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
| var minified = Regex.Replace(css, @"\s*([,>+;:}{]{1})\s*", "$1").Replace(";}", "}"); | |
| // ...where css is a string containing valid CSS | |
| // There are several ways to optimize this; I would use a compiled regex and | |
| // put it in an extension method for ease of use | |
| public static class Extensions { | |
| static Extensions() // static constructor |
NewerOlder