tailwindcss 0.0.0-insiders.776d5bf → 0.0.0-insiders.778bea7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli/build/plugin.js +13 -9
- package/lib/cli/build/watching.js +1 -1
- package/lib/cli/help/index.js +2 -2
- package/lib/cli/index.js +3 -3
- package/lib/corePlugins.js +160 -162
- package/lib/featureFlags.js +6 -5
- package/lib/lib/content.js +2 -2
- package/lib/lib/evaluateTailwindFunctions.js +4 -4
- package/lib/lib/expandTailwindAtRules.js +10 -9
- package/lib/lib/generateRules.js +19 -11
- package/lib/lib/resolveDefaultsAtRules.js +1 -1
- package/lib/lib/setupContextUtils.js +66 -41
- package/lib/lib/setupTrackingContext.js +3 -2
- package/lib/lib/substituteScreenAtRules.js +2 -2
- package/lib/plugin.js +9 -5
- package/lib/postcss-plugins/nesting/index.js +1 -1
- package/lib/postcss-plugins/nesting/plugin.js +2 -2
- package/lib/processTailwindFeatures.js +3 -3
- package/lib/public/colors.js +1 -1
- package/lib/util/color.js +3 -3
- package/lib/util/createUtilityPlugin.js +2 -2
- package/lib/util/dataTypes.js +61 -7
- package/lib/util/defaults.js +4 -4
- package/lib/util/escapeClassName.js +2 -2
- package/lib/util/formatVariantSelector.js +11 -9
- package/lib/util/getAllConfigs.js +3 -2
- package/lib/util/normalizeConfig.js +26 -21
- package/lib/util/normalizeScreens.js +3 -3
- package/lib/util/pluginUtils.js +6 -6
- package/lib/util/prefixSelector.js +1 -1
- package/lib/util/resolveConfig.js +10 -6
- package/lib/util/withAlphaVariable.js +1 -1
- package/package.json +13 -13
- package/src/cli/build/plugin.js +8 -4
- package/src/corePlugins.js +14 -14
- package/src/lib/expandTailwindAtRules.js +15 -11
- package/src/lib/generateRules.js +13 -6
- package/src/lib/setupContextUtils.js +18 -5
- package/src/plugin.js +9 -4
- package/src/processTailwindFeatures.js +3 -2
- package/src/util/dataTypes.js +59 -11
- package/src/util/formatVariantSelector.js +4 -3
- package/src/util/normalizeConfig.js +1 -1
- package/src/util/prefixSelector.js +1 -0
- package/types/config.d.ts +6 -6
package/lib/cli/build/plugin.js
CHANGED
|
@@ -79,7 +79,10 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
79
79
|
}
|
|
80
80
|
return newObj;
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
function license() {
|
|
83
|
+
return `/* ! tailwindcss v${_packagejson.default.version} | MIT License | https://tailwindcss.com */\n`;
|
|
84
|
+
}
|
|
85
|
+
async function lightningcss(result, { map = true, minify = true } = {}) {
|
|
83
86
|
try {
|
|
84
87
|
var _browserslist_findConfig;
|
|
85
88
|
var _result_opts_from;
|
|
@@ -123,7 +126,7 @@ async function lightningcss(result, { map =true , minify =true } = {}) {
|
|
|
123
126
|
let file = _path.default.resolve(customPostCssPath);
|
|
124
127
|
// Implementation, see: https://unpkg.com/browse/postcss-load-config@3.1.0/src/index.js
|
|
125
128
|
// @ts-ignore
|
|
126
|
-
let { config ={}
|
|
129
|
+
let { config = {} } = await (0, _lilconfig.lilconfig)("postcss").load(file);
|
|
127
130
|
if (typeof config === "function") {
|
|
128
131
|
config = config();
|
|
129
132
|
} else {
|
|
@@ -177,6 +180,7 @@ let state = {
|
|
|
177
180
|
};
|
|
178
181
|
},
|
|
179
182
|
loadConfig (configPath, content) {
|
|
183
|
+
var _content;
|
|
180
184
|
if (this.watcher && configPath) {
|
|
181
185
|
this.refreshConfigDependencies();
|
|
182
186
|
}
|
|
@@ -193,7 +197,7 @@ let state = {
|
|
|
193
197
|
};
|
|
194
198
|
this.configBag.config = (0, _validateConfig.validateConfig)((0, _resolveConfig.default)(this.configBag.config));
|
|
195
199
|
// Override content files if `--content` has been passed explicitly
|
|
196
|
-
if ((content === null ||
|
|
200
|
+
if (((_content = content) === null || _content === void 0 ? void 0 : _content.length) > 0) {
|
|
197
201
|
this.configBag.config.content.files = content;
|
|
198
202
|
}
|
|
199
203
|
return this.configBag.config;
|
|
@@ -226,7 +230,7 @@ let state = {
|
|
|
226
230
|
let rawContent = this.config.content.files.filter((file)=>{
|
|
227
231
|
return file !== null && typeof file === "object";
|
|
228
232
|
});
|
|
229
|
-
for (let { raw: htmlContent
|
|
233
|
+
for (let { raw: htmlContent, extension = "html" } of rawContent){
|
|
230
234
|
content.push({
|
|
231
235
|
content: htmlContent,
|
|
232
236
|
extension
|
|
@@ -234,7 +238,7 @@ let state = {
|
|
|
234
238
|
}
|
|
235
239
|
return content;
|
|
236
240
|
},
|
|
237
|
-
getContext ({ createContext
|
|
241
|
+
getContext ({ createContext, cliConfigPath, root, result, content }) {
|
|
238
242
|
if (this.context) {
|
|
239
243
|
this.context.changedContent = this.changedContent.splice(0);
|
|
240
244
|
return this.context;
|
|
@@ -292,9 +296,9 @@ async function createProcessor(args, cliConfigPath) {
|
|
|
292
296
|
let tailwindPlugin = ()=>{
|
|
293
297
|
return {
|
|
294
298
|
postcssPlugin: "tailwindcss",
|
|
295
|
-
Once (root, { result
|
|
299
|
+
async Once (root, { result }) {
|
|
296
300
|
_sharedState.env.DEBUG && console.time("Compiling CSS");
|
|
297
|
-
(0, _processTailwindFeatures.default)(({ createContext
|
|
301
|
+
await (0, _processTailwindFeatures.default)(({ createContext })=>{
|
|
298
302
|
console.error();
|
|
299
303
|
console.error("Rebuilding...");
|
|
300
304
|
return ()=>{
|
|
@@ -360,11 +364,11 @@ async function createProcessor(args, cliConfigPath) {
|
|
|
360
364
|
return result;
|
|
361
365
|
}).then((result)=>{
|
|
362
366
|
if (!output) {
|
|
363
|
-
process.stdout.write(result.css);
|
|
367
|
+
process.stdout.write(license() + result.css);
|
|
364
368
|
return;
|
|
365
369
|
}
|
|
366
370
|
return Promise.all([
|
|
367
|
-
(0, _utils.outputFile)(result.opts.to, result.css),
|
|
371
|
+
(0, _utils.outputFile)(result.opts.to, license() + result.css),
|
|
368
372
|
result.map && (0, _utils.outputFile)(result.opts.to + ".map", result.map.toString())
|
|
369
373
|
]);
|
|
370
374
|
}).then(()=>{
|
|
@@ -20,7 +20,7 @@ function _interop_require_default(obj) {
|
|
|
20
20
|
default: obj
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
function createWatcher(args, { state
|
|
23
|
+
function createWatcher(args, { state, rebuild }) {
|
|
24
24
|
let shouldPoll = args["--poll"];
|
|
25
25
|
let shouldCoalesceWriteEvents = shouldPoll || process.platform === "win32";
|
|
26
26
|
// Polling interval in milliseconds
|
package/lib/cli/help/index.js
CHANGED
|
@@ -15,7 +15,7 @@ function _interop_require_default(obj) {
|
|
|
15
15
|
default: obj
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function help({ message
|
|
18
|
+
function help({ message, usage, commands, options }) {
|
|
19
19
|
let indent = 2;
|
|
20
20
|
// Render header
|
|
21
21
|
console.log();
|
|
@@ -60,7 +60,7 @@ function help({ message , usage , commands , options }) {
|
|
|
60
60
|
}
|
|
61
61
|
console.log();
|
|
62
62
|
console.log("Options:");
|
|
63
|
-
for (let { flags
|
|
63
|
+
for (let { flags, description, deprecated } of Object.values(groupedOptions)){
|
|
64
64
|
if (deprecated) continue;
|
|
65
65
|
if (flags.length === 1) {
|
|
66
66
|
console.log(" ".repeat(indent + 4 /* 4 = "-i, ".length */ ), flags.slice().reverse().join(", ").padEnd(20, " "), description);
|
package/lib/cli/index.js
CHANGED
|
@@ -144,15 +144,15 @@ if (commands[command] === undefined) {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
// Execute command
|
|
147
|
-
let { args: flags
|
|
147
|
+
let { args: flags, run } = commands[command];
|
|
148
148
|
let args = (()=>{
|
|
149
149
|
try {
|
|
150
150
|
let result = (0, _arg.default)(Object.fromEntries(Object.entries({
|
|
151
151
|
...flags,
|
|
152
152
|
...sharedFlags
|
|
153
153
|
}).filter(([_key, value])=>{
|
|
154
|
-
var _value_type;
|
|
155
|
-
return !(value === null ||
|
|
154
|
+
var _value_type, _value;
|
|
155
|
+
return !((_value = value) === null || _value === void 0 ? void 0 : (_value_type = _value.type) === null || _value_type === void 0 ? void 0 : _value_type.manualParsing);
|
|
156
156
|
}).map(([key, value])=>[
|
|
157
157
|
key,
|
|
158
158
|
typeof value === "object" ? value.type : value
|