Grunt: style: "compressed" VS cssmin

I'm new to Grunt and I'm wondering why one should use grunt-contrib-cssmin instead of creating dev / dist versions like in this example:

    sass: {
        dist: {
            options: {
                style: 'compressed',
            },
            files: [{
                expand: true,
                cwd: 'assets/styles/source',
                src: [
                    '*.scss'
                ],
                dest: 'assets/styles/build',
                ext: '.min.css'
            }]
        },
        dev: {
            options: {
                style: 'extended',
            },
            files: [{
                expand: true,
                cwd: 'assets/styles/source',
                src: [
                    '*.scss'
                ],
                dest: 'assets/styles/build',
                ext: '.css'
            }]
        }           
    }

      

+3


source to share


1 answer


Sass compression option does, see also http://sass-lang.com/documentation/file.SASS_REFERENCE.html#_16 :

The compressed style takes up minimal space, probably no spaces, except for the need to separate selectors and newline at the end of the file. It also includes some other minor compressions, such as choosing the lowest representation for colors. It is not meant to be read by humans.



grunt-contribe-cssmin uses clean-css to compress AND optimizes your CSS. The optimizations that Clean-css and Sass compress do, among other things, are merging selectors and properties, shrinking, etc. (Advanced optimization), order-based property merge, @ media` merge, restructuring optimization and shorthand compaction

+2


source







All Articles