gpt4 book ai didi

sass - 咕噜声 : style: 'compressed' VS cssmin

转载 作者:行者123 更新时间:2023-12-01 23:44:40 26 4
gpt4 key购买 nike

我是 Grunt 的新手,我想知道为什么应该使用 grunt-contrib-cssmin 而不是像本例中那样创建 dev/dist 版本:

    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'
}]
}
}

最佳答案

Sass 的压缩选项可以,另见 http://sass-lang.com/documentation/file.SASS_REFERENCE.html#_16 :

Compressed style takes up the minimum amount of space possible, having no whitespace except that necessary to separate selectors and a newline at the end of the file. It also includes some other minor compressions, such as choosing the smallest representation for colors. It’s not meant to be human-readable.

grunt-contribe-cssmin 使用 clean-css压缩和优化您的 CSS。 Clean-css 进行的优化,而 Sass 压缩不进行的优化包括:选择器和属性合并、缩减等(高级优化)、基于顺序的属性合并、@media` 合并、重组优化和速记压缩

关于sass - 咕噜声 : style: 'compressed' VS cssmin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29950778/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com