forked from csstools/postcss-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.ts
More file actions
213 lines (208 loc) · 7.21 KB
/
cli.ts
File metadata and controls
213 lines (208 loc) · 7.21 KB
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
import cssBlankPseudo from './plugins/css-blank-pseudo';
import cssHasPseudo from './plugins/css-has-pseudo';
import cssPrefersColorScheme from './plugins/css-prefers-color-scheme';
import postcssAttributeCaseInsensitive from './plugins/postcss-attribute-case-insensitive';
import postcssCascadeLayers from './plugins/postcss-cascade-layers';
import postcssColorFunction from './plugins/postcss-color-function';
import postcssColorFunctionalNotation from './plugins/postcss-color-functional-notation';
import postcssColorHexAlpha from './plugins/postcss-color-hex-alpha';
import postcssColorRebeccaPurple from './plugins/postcss-color-rebeccapurple';
import postcssCustomMedia from './plugins/postcss-custom-media';
import postcssCustomProperties from './plugins/postcss-custom-properties';
import postcssCustomSelectors from './plugins/postcss-custom-selectors';
import postcssDirPseudoClass from './plugins/postcss-dir-pseudo-class';
import postcssDoublePositionGradients from './plugins/postcss-double-position-gradients';
import postcssFocusVisible from './plugins/postcss-focus-visible';
import postcssFocusWithin from './plugins/postcss-focus-within';
import postcssFontFormatKeywords from './plugins/postcss-font-format-keywords';
import postcssGapProperties from './plugins/postcss-gap-properties';
import postcssHWBFunction from './plugins/postcss-hwb-function';
import postcssICUnit from './plugins/postcss-ic-unit';
import postcssImageSetFunction from './plugins/postcss-image-set-function';
import postcssIsPseudoClass from './plugins/postcss-is-pseudo-class';
import postcssLabFunction from './plugins/postcss-lab-function';
import postcssLogical from './plugins/postcss-logical';
import postcssLogicalFloatAndClear from './plugins/postcss-logical-float-and-clear';
import postcssLogicalResize from './plugins/postcss-logical-resize';
import postcssLogicalViewportUnits from './plugins/postcss-logical-viewport-units';
import postcssNesting from './plugins/postcss-nesting';
import postcssNormalizeDisplayValues from './plugins/postcss-normalize-display-values';
import postcssOKLabFunction from './plugins/postcss-oklab-function';
import postcssOverflowShorthand from './plugins/postcss-overflow-shorthand';
import postcssPlace from './plugins/postcss-place';
import postcssPresetEnv from './plugins/postcss-preset-env';
import postcssPseudoClassAnyLink from './plugins/postcss-pseudo-class-any-link';
import postcssSelectorNot from './plugins/postcss-selector-not';
import postcssSteppedValueFunctions from './plugins/postcss-stepped-value-functions';
import postcssTrigonometricFunctions from './plugins/postcss-trigonometric-functions';
import postcssUnsetValue from './plugins/postcss-unset-value';
main();
function main() {
switch (process.argv[2] ?? false) {
case 'css-blank-pseudo':
cssBlankPseudo();
return;
case 'css-has-pseudo':
cssHasPseudo();
return;
case 'css-prefers-color-scheme':
cssPrefersColorScheme();
return;
case 'postcss-attribute-case-insensitive':
postcssAttributeCaseInsensitive();
return;
case 'postcss-cascade-layers':
postcssCascadeLayers();
return;
case 'postcss-color-function':
postcssColorFunction();
return;
case 'postcss-color-functional-notation':
postcssColorFunctionalNotation();
return;
case 'postcss-color-hex-alpha':
postcssColorHexAlpha();
return;
case 'postcss-color-rebeccapurple':
postcssColorRebeccaPurple();
return;
case 'postcss-custom-media':
postcssCustomMedia();
return;
case 'postcss-custom-properties':
postcssCustomProperties();
return;
case 'postcss-custom-selectors':
postcssCustomSelectors();
return;
case 'postcss-dir-pseudo-class':
postcssDirPseudoClass();
return;
case 'postcss-double-position-gradients':
postcssDoublePositionGradients();
return;
case 'postcss-focus-visible':
postcssFocusVisible();
return;
case 'postcss-focus-within':
postcssFocusWithin();
return;
case 'postcss-font-format-keywords':
postcssFontFormatKeywords();
return;
case 'postcss-gap-properties':
postcssGapProperties();
return;
case 'postcss-hwb-function':
postcssHWBFunction();
return;
case 'postcss-ic-unit':
postcssICUnit();
return;
case 'postcss-image-set-function':
postcssImageSetFunction();
return;
case 'postcss-is-pseudo-class':
postcssIsPseudoClass();
return;
case 'postcss-lab-function':
postcssLabFunction();
return;
case 'postcss-logical':
postcssLogical();
return;
case 'postcss-logical-float-and-clear':
postcssLogicalFloatAndClear();
return;
case 'postcss-logical-resize':
postcssLogicalResize();
return;
case 'postcss-logical-viewport-units':
postcssLogicalViewportUnits();
return;
case 'postcss-nesting':
postcssNesting();
return;
case 'postcss-normalize-display-values':
postcssNormalizeDisplayValues();
return;
case 'postcss-oklab-function':
postcssOKLabFunction();
return;
case 'postcss-overflow-shorthand':
postcssOverflowShorthand();
return;
case 'postcss-place':
postcssPlace();
return;
case 'postcss-preset-env':
postcssPresetEnv();
return;
case 'postcss-pseudo-class-any-link':
postcssPseudoClassAnyLink();
return;
case 'postcss-selector-not':
postcssSelectorNot();
return;
case 'postcss-stepped-value-functions':
postcssSteppedValueFunctions();
return;
case 'postcss-trigonometric-functions':
postcssTrigonometricFunctions();
return;
case 'postcss-unset-value':
postcssUnsetValue();
return;
default:
{
const allHelp = [
'CSSTools CLI\n',
' Transform CSS with any plugin from https://github.com/csstools/postcss-plugins\n',
'Usage:',
' @csstools/csstools-cli postcss-preset-env [input.css] [OPTIONS] [-o|--output output.css]',
' @csstools/csstools-cli postcss-preset-env <input.css>... [OPTIONS] --dir <output-directory>',
' @csstools/csstools-cli postcss-preset-env <input.css>... [OPTIONS] --replace',
'\nAvailable Plugins:',
' css-blank-pseudo',
' css-has-pseudo',
' css-prefers-color-scheme',
' postcss-attribute-case-insensitive',
' postcss-cascade-layers',
' postcss-color-function',
' postcss-color-functional-notation',
' postcss-color-hex-alpha',
' postcss-color-rebeccapurple',
' postcss-custom-media',
' postcss-custom-properties',
' postcss-custom-selectors',
' postcss-dir-pseudo-class',
' postcss-double-position-gradients',
' postcss-env-function',
' postcss-focus-visible',
' postcss-focus-within',
' postcss-font-format-keywords',
' postcss-gap-properties',
' postcss-hwb-function',
' postcss-ic-unit',
' postcss-image-set-function',
' postcss-is-pseudo-class',
' postcss-lab-function',
' postcss-logical',
' postcss-nesting',
' postcss-normalize-display-values',
' postcss-oklab-function',
' postcss-overflow-shorthand',
' postcss-place',
' postcss-pseudo-class-any-link',
' postcss-selector-not',
' postcss-stepped-value-functions',
' postcss-trigonometric-functions',
' postcss-unset-value',
'\nPlugin Help:',
' @csstools/csstools-cli <plugin-name>',
' @csstools/csstools-cli postcss-preset-env',
];
console.warn(allHelp.join('\n'));
}
}
}