CleanCss

编程之家收集整理的这个编程导航主要介绍了CleanCss编程之家,现在分享给大家,也给大家做个参考。

CleanCss

CleanCss 介绍

Clean-css 是一个非常简单的 css 压缩程序,基于Node.js环境开发使用,可以删除 css 中一些无用的空格、评论以及每个选择器后面的分号,还可以压缩通过@import引入的css文件

环境依赖

Node.js 4.0+ (tested on CentOS,Ubuntu,OS X,and Windows)

通过npm安装

npm install clean-css

如何使用命令行

Clean-css接受下列命令行参数,使用时请将需要优化的css文件<source-file>放置到最后一个参数后面,避免遇到潜在的不可预想的问题。

cleancss [options] source-file,[source-file,...]

-h,--help output usage @R_942_4045@ion

-v,--version output the version number

-b,--keep-line-breaks Keep line breaks

-c,--compatibility [ie7|ie8] Force compatibility mode (see Readme for advanced examples)

-d,--debug Shows debug @R_942_4045@ion (minification time & compression efficiency)

-o,--output [output-file] Use [output-file] as output instead of STDOUT

-r,--root [root-path] Set a root path to which resolve absolute @import rules

-s,--skip-import disable @import processing

-t,--timeout [seconds] Per connection timeout when fetching remote @imports (defaults to 5 seconds)

--rounding-precision [n] Rounds to `N` decimal places. Defaults to 2. -1 disables rounding

--s0 Remove all special comments,i.e. /*! comment */

--s1 Remove all special comments but the first one

--semantic-merging Enables unsafe mode by assuming BEM-like semantic stylesheets (warning,this may break your styling!)

--skip-advanced disable advanced optimizations - ruleset reordering & merging

--skip-aggressive-merging disable properties merging based on their order

--skip-import-from [rules] disable @import processing for specified rules

--skip-media-merging disable @media merging

--skip-rebase disable URLs rebasing

--skip-restructuring disable restructuring optimizations

--skip-shorthand-compacting disable shorthand compacting

--source-map Enables building input's source map

--source-map-inline-sources Enables inlining sources inside source maps

网站地址:https://jakubpawlowicz.github.io/clean-css/

GitHub:https://github.com/jakubpawlowicz/clean-css

网站描述:基于Node.js的CSS代码压缩工具

CleanCss官方网站

官方网站:https://jakubpawlowicz.github.io/clean-css/

如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。

相关文章

Basscss,一个CSS重置,网格系统、颜色类、实用类等来帮助你建...
sandal,Sass 的基础库
CssLoad,完全基于CSS的加载动画设计工具
tachyons,轻便实用的 css 框架
CssDeck,在线CSS代码编辑器及共享网
Pure.css,雅虎出品的一组轻量级、响应式纯css模块