-
Notifications
You must be signed in to change notification settings - Fork 16
/
cssnano.node_cli.txt
144 lines (96 loc) · 7.98 KB
/
cssnano.node_cli.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
CSSNANO
ALTERNATIVES ==> # - cssnano (prefer): more modular. Good compression but slow
# - cleancss
# - csso
VERSION ==> #3.5.2
#CSS minifier
CSSNANO.process('CSS', OPTS)-> #As Node module
PROMISE(RESULT) #OPTS are passed to PostCSS (e.g. sourcemap options)
OPTS.OPTIMIZATION #BOOL|PLUGIN_OPTS (def: true for all)
OPTS.safe #BOOL (def: false). Disable reduceIdents, zindex, discardUnused, convertValues
#Might be a good idea because it does not change size that much.
CSSNANO(OPTS) #As PostCSS plugin
cssnano [FILE.css...] [FILE2.css] #CLI (1.0.3)
--no-FEATURE #
--safe #
--sourcemap #
/=+===============================+=\
/ : : \
)==: CORE :==(
\ :_______________________________: /
\=+===============================+=/
core #Does:
# - remove whitespaces
# - remove last semicolon of ruleset
autoprefixer #See autoprefixer doc
#Can e.g. remove useless vendor prefixes
svgo #Reduce SVG embedded as data URI, using svgo
#PLUGIN_OPTS:
# - encode BOOL: if true, URL-encodes. If false, URL-decodes. If undefined (def), do nothing
# - plugins OBJ_ARR: PLUGIN: SVGO_PLUGIN_OPTS (see svgo doc)
/=+===============================+=\
/ : : \
)==: SIMPLE SHORTENER :==(
\ :_______________________________: /
\=+===============================+=/
minifySelectors #Remove whitespaces in SELECTORS
convertValues #Minify LEN|TIME|ANGLE
#PLUGIN_OPTS: length|time|angle BOOL (def: true)
colormin #Minify COLOR
minifyGradients #Minify *-gradient()
reduceTransforms #Minify transform: FUNC()
calc #Reduce calc(), see CSS doc for PLUGIN_OPTS
/=+===============================+=\
/ : : \
)==: DUPLICATES :==(
\ :_______________________________: /
\=+===============================+=/
uniqueSelectors #Remove duplicate SELECTOR inside same SELECTORS
discardDuplicates #Remove duplicate rules, i.e. exact same RULE + SELECTORS
minifyFontValues #Minify font-family|weight and duplicate font families
#PLUGIN_OPTS: removeAfterKeyword|removeDuplicates|removeQuotes BOOL (def: true)
/=+===============================+=\
/ : : \
)==: MERGE :==(
\ :_______________________________: /
\=+===============================+=/
mergeRules #If two identical rules from two adjacent rulesets, merge it into one ruleset.
mergeLonghand #Use shorthand properties
mergeIndents #Merge duplicate @counter-style, @keyframes if same rules but different variable name
/=+===============================+=\
/ : : \
)==: UNUSED :==(
\ :_______________________________: /
\=+===============================+=/
discardComments #Remove /* COMMENT */ but not /*! COMMENT */
#PLUGIN_OPTS:
# - removeAll BOOL (def: false): remove /*! COMMENT */
# - removeAllButFirst BOOL (def: false): remove /*! COMMENT */ but not first one
# - remove(STR)->BOOL: custom filter
discardEmpty #Remove empty rulesets
discardUnused #Remove unused @counter-style, @keyframes, @font-face, @namespace
#PLUGIN_OPTS: counterStyle|keyframes|fontFace|namespace BOOL (def: true)
/=+===============================+=\
/ : : \
)==: NORMALIZE :==(
\ :_______________________________: /
\=+===============================+=/
normalizeCharset #Remove duplicate @charset
#If PLUGIN_OPTS.add true (def), add it if not present
reduceIdents #Minify @counter*, @keyframes, @counter-style variable names
#PLUGIN_OPTS: counter|keyframes|counterStyle BOOL (def: true)
normalizeUrl #Normalize|minify url()
#Does:
# - remove quotes
# - put lowercase
# - prepend http: if starts with '//', if PLUGIN_OPTS.normalizeProtocol true (def)
# - remove www., if PLUGIN_OPTS.stripWWW true (def)
# - remove default port
# - resolve . and ..
# - remove extra slashes
# - sort query variables
# - remove #HASH, if PLUGIN_OPTS.stripFragment true (def)
zindex #Normalize z-index NUM
orderedValues #Sort shorthand properties values