Man page - cleancss(1)
Packages contains this manual
Manual
CLEANCSS
NAMESYNOPSIS
OPTIONS
Examples:
Formatting options:
Level 0 optimizations:
Level 1 optimizations:
Level 2 optimizations:
NAME
cleancss - cleancss - fast and efficient CSS optimizer
SYNOPSIS
cleancss [ options ] <source-file ... >
OPTIONS
-v , --version
output the version number
-c , --compatibility [ie7|ie8]
Force compatibility mode (see Readme for advanced examples)
-d , --debug
Shows debug information (minification time & compression efficiency)
-f , --format <options>
Controls output formatting, see examples below
-o , --output [output-file]
Use [output-file] as output instead of STDOUT
-O <n> [optimizations]
Turn on level <n> optimizations; optionally accepts a list of fine-grained options, defaults to â1â, see examples below
--inline [rules]
Enables inlining for listed sources (defaults to âlocalâ)
--inline-timeout [seconds]
Per connection timeout when fetching remote stylesheets (defaults to 5 seconds)
--remove-inlined-files
Remove files inlined in <source-file ...> or via â@importâ statements
--skip-rebase
Disable URLs rebasing
--source-map
Enables building inputâs source map
--source-map-inline-sources
Enables inlining sources inside source maps
--input-source-map [file]
Specifies the path of the input source map file
-h , --help
output usage information
Examples:
%> cleancss
one.css
%> cleancss
-o
one-min.css one.css
%> cleancss
-o
merged-and-minified.css one.css
two.css three.css
%> cleancss one.css two.css three.css | gzip
-9 -c
>
merged-minified-and-gzipped.css.gz
Formatting options:
%> cleancss
--format
beautify one.css
%> cleancss
--format
keep-breaks one.css
%> cleancss
--format
âindentBy:1;indentWith:tabâ one.css
%> cleancss
--format
âbreaks:afterBlockBegins=on;spaces:aroundSelectorRelation=onâ
one.css
%> # âbreaksâ controls where to insert breaks
%> # âafterAtRuleâ controls if a line break
comes after an at-rule;
e.g. â@charsetâ; defaults to âoffâ
(alias to âfalseâ)
%> # âafterBlockBeginsâ controls if a line
break comes after a block
begins; e.g. â@mediaâ; defaults to
âoffâ
%> # âafterBlockEndsâ controls if a line
break comes after a block
ends, defaults to âoffâ
%> # âafterCommentâ controls if a line break
comes after a comment;
defaults to âoffâ
%> # âafterPropertyâ controls if a line break
comes after a property;
defaults to âoffâ
%> # âafterRuleBeginsâ controls if a line
break comes after a rule
begins; defaults to âoffâ
%> # âafterRuleEndsâ controls if a line break
comes after a rule
ends; defaults to âoffâ
%> # âbeforeBlockEndsâ controls if a line
break comes before a block
ends; defaults to âoffâ
%> # âbetweenSelectorsâ controls if a line
break comes between
selectors; defaults to âoffâ
%> # âindentByâ controls number of characters
to indent with; defaults
to â0â
%> # âindentWithâ controls a character to
indent with, can be âspaceâ
or âtabâ; defaults to âspaceâ
%> # âspacesâ controls where to insert spaces
%> # âaroundSelectorRelationâ controls if
spaces come around selector
relations; e.g. âdiv > aâ; defaults to
âoffâ
%> # âbeforeBlockBeginsâ controls if a space
comes before a block
begins; e.g. â.block {â; defaults to
âoffâ
%> # âbeforeValueâ controls if a space comes
before a value; e.g.
âwidth: 1remâ; defaults to âoffâ
%> # âwrapAtâ controls maximum line length;
defaults to âoffâ
Level 0 optimizations:
%> cleancss -O0 one.css
Level 1 optimizations:
%> cleancss
-O1
one.css
%> cleancss
-O1
removeQuotes:off;roundingPrecision:4;specialComments:1
one.css
%> cleancss
-O1
all:off;specialComments:1 one.css
%> # âcleanupCharsetsâ controls
â@charsetâ moving to the front of a
stylesheet; defaults to âonâ
%> # ânormalizeUrlsâ controls URL
normalzation; default to âonâ
%> # âoptimizeBackgroundâ controls
âbackgroundâ property optimizatons;
defaults to âonâ
%> # âoptimizeBorderRadiusâ controls
âborder-radiusâ property
optimizatons; defaults to âonâ
%> # âoptimizeFilterâ controls
âfilterâ property optimizatons; defaults
to âonâ
%> # âoptimizeFontWeightâ controls
âfont-weightâ property optimizatons;
defaults to âonâ
%> # âoptimizeOutlineâ controls
âoutlineâ property optimizatons;
defaults to âonâ
%> # âremoveEmptyâ controls removing empty
rules and nested blocks;
defaults to âonâ (since 4.1.0)
%> # âremoveNegativePaddingsâ controls
removing negative paddings;
defaults to âonâ
%> # âremoveQuotesâ controls removing quotes
when unnecessary; defaults
to âonâ
%> # âremoveWhitespaceâ controls removing
unused whitespace; defaults
to âonâ
%> # âreplaceMultipleZerosâ contols removing
redundant zeros; defaults
to âonâ
%> # âreplaceTimeUnitsâ controls replacing
time units with shorter
values; defaults to âon
%> # âreplaceZeroUnitsâ controls replacing
zero values with units;
defaults to âonâ
%> # âroundingPrecisionâ rounds pixel values
to âNâ decimal places;
âoffâ disables rounding; defaults to
âoffâ
%> # âselectorsSortingMethodâ denotes
selector sorting method; can be
ânaturalâ or âstandardâ; defaults to
âstandardâ
%> # âspecialCommentsâ denotes a number of
/*! ... */ comments
preserved; defaults to âallâ
%> # âtidyAtRulesâ controls at-rules (e.g.
â@charsetâ, â@importâ)
optimizing; defaults to âonâ
%> # âtidyBlockScopesâ controls block scopes
(e.g. â@mediaâ)
optimizing; defaults to âonâ
%> # âtidySelectorsâ controls selectors
optimizing; defaults to âonâ
Level 2 optimizations:
%> cleancss
-O2
one.css
%> cleancss
-O2
mergeMedia:off;restructureRules:off;mergeSemantically:on;mergeIntoShorthands:off
one.css
%> cleancss
-O2
all:off;removeDuplicateRules:on
one.css
%> # âmergeAdjacentRulesâ controls adjacent
rules merging; defaults to
âonâ
%> # âmergeIntoShorthandsâ controls merging
properties into shorthands;
defaults to âonâ
%> # âmergeMediaâ controls
â@mediaâ merging; defaults to âonâ
%> # âmergeNonAdjacentRulesâ controls
non-adjacent rule merging;
defaults to âonâ
%> # âmergeSemanticallyâ controls semantic
merging; defaults to âoffâ
%> # âoverridePropertiesâ controls property
overriding based on
understandability; defaults to âonâ
%> # âreduceNonAdjacentRulesâ controls
non-adjacent rule reducing;
defaults to âonâ
%> # âremoveDuplicateFontRulesâ controls
duplicate â@font-faceâ
removing; defaults to âonâ
%> # âremoveDuplicateMediaBlocksâ controls
duplicate â@mediaâ removing;
defaults to âonâ
%> # âremoveDuplicateRulesâ controls
duplicate rules removing; defaults
to âonâ
%> # âremoveEmptyâ controls removing empty
rules and nested blocks;
defaults to âonâ (since 4.1.0)
%> # âremoveUnusedAtRulesâ controls unused at
rule removing; defaults
to âoffâ (since 4.1.0)
%> # ârestructureRulesâ controls rule
restructuring; defaults to âoffâ
%> # âskipPropertiesâ controls which
properties wonât be optimized,
defaults to empty list which means all will be optimized
(since 4.1.0)