Created
July 15, 2017 18:04
-
-
Save loechel/a8d037908d0158f14b1841e1bb3d72a8 to your computer and use it in GitHub Desktop.
Comparission PyScss vs cssmin for Plone CSS minification
This file contains 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
import cssmin | |
from scss import Compiler | |
css = """ | |
/*! Loud Comment */ | |
/*! | |
Multi Line Loud Comment | |
Comments on multiple lines | |
without leading * for multi line comment | |
*/ | |
a { | |
border: thin solid red; | |
} | |
// Comment | |
/* Comment 2 */ | |
/* | |
* Multi Line Comment | |
* @param descriptions | |
*/ | |
body { | |
font-size: 10px; | |
div { color: blue; } | |
/* | |
Comments on multiple lines | |
without leading * for multi line comment | |
*/ | |
} | |
""" | |
print(u'Result cssmin:\n') | |
print(cssmin.cssmin(css)) | |
print(u'\n\npyScss - SASS Preprocessor') | |
print(u'SASS - mode nested (default)') | |
compiler = Compiler() | |
print(compiler.compile_string(css)) | |
print(u'SASS - mode compact') | |
compiler = Compiler(output_style='compact') | |
print(compiler.compile_string(css)) | |
compiler.compile_string(css) | |
print(u'SASS - mode compressed') | |
compiler = Compiler(output_style='compressed') | |
print(compiler.compile_string(css)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment