tailwindcss 0.0.0-insiders.68f18bf → 0.0.0-insiders.6c4b86d
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/CHANGELOG.md +42 -3
- package/lib/cli.js +61 -61
- package/lib/constants.js +1 -1
- package/lib/corePluginList.js +5 -1
- package/lib/corePlugins.js +101 -18
- package/lib/featureFlags.js +3 -3
- package/lib/lib/collapseDuplicateDeclarations.js +2 -2
- package/lib/lib/detectNesting.js +17 -2
- package/lib/lib/evaluateTailwindFunctions.js +3 -3
- package/lib/lib/expandApplyAtRules.js +7 -7
- package/lib/lib/generateRules.js +10 -10
- package/lib/lib/resolveDefaultsAtRules.js +2 -2
- package/lib/lib/setupContextUtils.js +9 -8
- package/lib/lib/sharedState.js +2 -2
- package/lib/util/createUtilityPlugin.js +2 -2
- package/lib/util/dataTypes.js +11 -0
- package/lib/util/formatVariantSelector.js +83 -8
- package/lib/util/normalizeConfig.js +7 -7
- package/lib/util/parseBoxShadowValue.js +77 -0
- package/lib/util/pluginUtils.js +12 -11
- package/lib/util/resolveConfig.js +8 -8
- package/lib/util/transformThemeValue.js +23 -13
- package/package.json +8 -8
- package/peers/index.js +3203 -2663
- package/src/cli.js +1 -1
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +60 -7
- package/src/lib/detectNesting.js +22 -3
- package/src/lib/setupContextUtils.js +2 -1
- package/src/lib/sharedState.js +1 -1
- package/src/util/dataTypes.js +13 -0
- package/src/util/formatVariantSelector.js +81 -0
- package/src/util/parseBoxShadowValue.js +71 -0
- package/src/util/pluginUtils.js +2 -0
- package/src/util/transformThemeValue.js +22 -7
- package/stubs/defaultConfig.stub.js +23 -14
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
Nothing yet!
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Enforce the order of some variants (like `before` and `after`) ([#6018](https://github.com/tailwindlabs/tailwindcss/pull/6018))
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Add `placeholder` variant ([#6106](https://github.com/tailwindlabs/tailwindcss/pull/6106))
|
|
19
|
+
|
|
20
|
+
## [3.0.0-alpha.2] - 2021-11-08
|
|
21
|
+
|
|
10
22
|
### Changed
|
|
11
23
|
|
|
12
24
|
- Don't use pointer cursor on disabled buttons by default ([#5772](https://github.com/tailwindlabs/tailwindcss/pull/5772))
|
|
@@ -22,7 +34,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
22
34
|
- Add all standard `cursor-*` values by default ([#5734](https://github.com/tailwindlabs/tailwindcss/pull/5734))
|
|
23
35
|
- Add `grow-*` and `shrink-*` utilities, deprecate `flex-grow-*` and `flex-shrink-*` ([#5733](https://github.com/tailwindlabs/tailwindcss/pull/5733))
|
|
24
36
|
- Add `text-decoration-color` utilities ([#5760](https://github.com/tailwindlabs/tailwindcss/pull/5760))
|
|
25
|
-
- Add declarative `addVariant`
|
|
37
|
+
- Add new declarative `addVariant` API ([#5809](https://github.com/tailwindlabs/tailwindcss/pull/5809))
|
|
38
|
+
- Add first-class `print` variant for targeting printed media ([#5885](https://github.com/tailwindlabs/tailwindcss/pull/5885))
|
|
39
|
+
- Add full color palette for `fill-*` and `stroke-*` utilities (#5933[](https://github.com/tailwindlabs/tailwindcss/pull/5933))
|
|
40
|
+
- Add composable API for colored box shadows ([#5979](https://github.com/tailwindlabs/tailwindcss/pull/5979))
|
|
26
41
|
|
|
27
42
|
### Fixed
|
|
28
43
|
|
|
@@ -32,6 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
32
47
|
- Cleanup duplicate properties ([#5830](https://github.com/tailwindlabs/tailwindcss/pull/5830))
|
|
33
48
|
- Allow `_` inside `url()` when using arbitrary values ([#5853](https://github.com/tailwindlabs/tailwindcss/pull/5853))
|
|
34
49
|
- Prevent crashes when using comments in `@layer` AtRules ([#5854](https://github.com/tailwindlabs/tailwindcss/pull/5854))
|
|
50
|
+
- Handle color transformations properly with `theme(...)` for all relevant plugins ([#4533](https://github.com/tailwindlabs/tailwindcss/pull/4533), [#5871](https://github.com/tailwindlabs/tailwindcss/pull/5871))
|
|
51
|
+
- Ensure `@apply`-ing a utility with multiple definitions works ([#5870](https://github.com/tailwindlabs/tailwindcss/pull/5870))
|
|
35
52
|
|
|
36
53
|
## [3.0.0-alpha.1] - 2021-10-01
|
|
37
54
|
|
|
@@ -72,6 +89,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
72
89
|
- Fix using negated `content` globs ([#5625](https://github.com/tailwindlabs/tailwindcss/pull/5625))
|
|
73
90
|
- Fix using backslashes in `content` globs ([#5628](https://github.com/tailwindlabs/tailwindcss/pull/5628))
|
|
74
91
|
|
|
92
|
+
## [2.2.19] - 2021-10-29
|
|
93
|
+
|
|
94
|
+
### Fixed
|
|
95
|
+
|
|
96
|
+
- Ensure `corePlugins` order is consisent in AOT mode ([#5928](https://github.com/tailwindlabs/tailwindcss/pull/5928))
|
|
97
|
+
|
|
98
|
+
## [2.2.18] - 2021-10-29
|
|
99
|
+
|
|
100
|
+
### Fixed
|
|
101
|
+
|
|
102
|
+
- Bump versions for security vulnerabilities ([#5924](https://github.com/tailwindlabs/tailwindcss/pull/5924))
|
|
103
|
+
|
|
104
|
+
## [2.2.17] - 2021-10-13
|
|
105
|
+
|
|
106
|
+
### Fixed
|
|
107
|
+
|
|
108
|
+
- Configure chokidar's `awaitWriteFinish` setting to avoid occasional stale builds on Windows ([#5758](https://github.com/tailwindlabs/tailwindcss/pull/5758))
|
|
109
|
+
|
|
75
110
|
## [2.2.16] - 2021-09-26
|
|
76
111
|
|
|
77
112
|
### Fixed
|
|
@@ -1630,8 +1665,12 @@ No release notes
|
|
|
1630
1665
|
|
|
1631
1666
|
- Everything!
|
|
1632
1667
|
|
|
1633
|
-
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.0-alpha.
|
|
1634
|
-
[3.0.0-alpha.
|
|
1668
|
+
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.0-alpha.2...HEAD
|
|
1669
|
+
[3.0.0-alpha.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.0-alpha.1...v3.0.0-alpha.2
|
|
1670
|
+
[3.0.0-alpha.1]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.19...v3.0.0-alpha.1
|
|
1671
|
+
[2.2.19]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.18...v2.2.19
|
|
1672
|
+
[2.2.18]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.17...v2.2.18
|
|
1673
|
+
[2.2.17]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.16...v2.2.17
|
|
1635
1674
|
[2.2.16]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.15...v2.2.16
|
|
1636
1675
|
[2.2.15]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15
|
|
1637
1676
|
[2.2.14]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.13...v2.2.14
|
package/lib/cli.js
CHANGED
|
@@ -22,7 +22,7 @@ function _interopRequireDefault(obj) {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
let env = {
|
|
25
|
-
DEBUG: process.env.DEBUG !== undefined
|
|
25
|
+
DEBUG: process.env.DEBUG !== undefined && process.env.DEBUG !== '0'
|
|
26
26
|
};
|
|
27
27
|
// ---
|
|
28
28
|
function indentRecursive(node, indent = 0) {
|
|
@@ -110,7 +110,7 @@ function oneOf(...options) {
|
|
|
110
110
|
manualParsing: true
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
-
let
|
|
113
|
+
let commands1 = {
|
|
114
114
|
init: {
|
|
115
115
|
run: init,
|
|
116
116
|
args: {
|
|
@@ -187,30 +187,30 @@ if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.
|
|
|
187
187
|
'tailwindcss [--input input.css] [--output output.css] [--watch] [options...]',
|
|
188
188
|
'tailwindcss init [--full] [--postcss] [options...]',
|
|
189
189
|
],
|
|
190
|
-
commands: Object.keys(
|
|
190
|
+
commands: Object.keys(commands1).filter((command)=>command !== 'build'
|
|
191
191
|
).map((command)=>`${command} [options]`
|
|
192
192
|
),
|
|
193
193
|
options: {
|
|
194
|
-
...
|
|
194
|
+
...commands1.build.args,
|
|
195
195
|
...sharedFlags
|
|
196
196
|
}
|
|
197
197
|
});
|
|
198
198
|
process.exit(0);
|
|
199
199
|
}
|
|
200
|
-
let
|
|
200
|
+
let command1 = ((arg = '')=>arg.startsWith('-') ? undefined : arg
|
|
201
201
|
)(process.argv[2]) || 'build';
|
|
202
|
-
if (
|
|
203
|
-
if (_fs.default.existsSync(_path.default.resolve(
|
|
202
|
+
if (commands1[command1] === undefined) {
|
|
203
|
+
if (_fs.default.existsSync(_path.default.resolve(command1))) {
|
|
204
204
|
// TODO: Deprecate this in future versions
|
|
205
205
|
// Check if non-existing command, might be a file.
|
|
206
|
-
|
|
206
|
+
command1 = 'build';
|
|
207
207
|
} else {
|
|
208
208
|
help({
|
|
209
|
-
message: `Invalid command: ${
|
|
209
|
+
message: `Invalid command: ${command1}`,
|
|
210
210
|
usage: [
|
|
211
211
|
'tailwindcss <command> [options]'
|
|
212
212
|
],
|
|
213
|
-
commands: Object.keys(
|
|
213
|
+
commands: Object.keys(commands1).filter((command)=>command !== 'build'
|
|
214
214
|
).map((command)=>`${command} [options]`
|
|
215
215
|
),
|
|
216
216
|
options: sharedFlags
|
|
@@ -219,11 +219,11 @@ if (commands[command] === undefined) {
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
// Execute command
|
|
222
|
-
let { args:
|
|
223
|
-
let
|
|
222
|
+
let { args: flags1 , run } = commands1[command1];
|
|
223
|
+
let args1 = (()=>{
|
|
224
224
|
try {
|
|
225
225
|
let result = (0, _arg).default(Object.fromEntries(Object.entries({
|
|
226
|
-
...
|
|
226
|
+
...flags1,
|
|
227
227
|
...sharedFlags
|
|
228
228
|
}).filter(([_key, value])=>{
|
|
229
229
|
var ref;
|
|
@@ -240,11 +240,11 @@ let args = (()=>{
|
|
|
240
240
|
let flag = result['_'][i];
|
|
241
241
|
if (!flag.startsWith('-')) continue;
|
|
242
242
|
let flagName = flag;
|
|
243
|
-
let handler =
|
|
243
|
+
let handler = flags1[flag];
|
|
244
244
|
// Resolve flagName & handler
|
|
245
245
|
while(typeof handler === 'string'){
|
|
246
246
|
flagName = handler;
|
|
247
|
-
handler =
|
|
247
|
+
handler = flags1[handler];
|
|
248
248
|
}
|
|
249
249
|
if (!handler) continue;
|
|
250
250
|
let args = [];
|
|
@@ -264,8 +264,8 @@ let args = (()=>{
|
|
|
264
264
|
//
|
|
265
265
|
// E.g.: tailwindcss input.css -> _: ['build', 'input.css']
|
|
266
266
|
// E.g.: tailwindcss build input.css -> _: ['build', 'input.css']
|
|
267
|
-
if (result['_'][0] !==
|
|
268
|
-
result['_'].unshift(
|
|
267
|
+
if (result['_'][0] !== command1) {
|
|
268
|
+
result['_'].unshift(command1);
|
|
269
269
|
}
|
|
270
270
|
return result;
|
|
271
271
|
} catch (err) {
|
|
@@ -282,14 +282,14 @@ let args = (()=>{
|
|
|
282
282
|
throw err;
|
|
283
283
|
}
|
|
284
284
|
})();
|
|
285
|
-
if (
|
|
285
|
+
if (args1['--help']) {
|
|
286
286
|
help({
|
|
287
287
|
options: {
|
|
288
|
-
...
|
|
288
|
+
...flags1,
|
|
289
289
|
...sharedFlags
|
|
290
290
|
},
|
|
291
291
|
usage: [
|
|
292
|
-
`tailwindcss ${
|
|
292
|
+
`tailwindcss ${command1} [options]`
|
|
293
293
|
]
|
|
294
294
|
});
|
|
295
295
|
process.exit(0);
|
|
@@ -299,17 +299,17 @@ run();
|
|
|
299
299
|
function init() {
|
|
300
300
|
let messages = [];
|
|
301
301
|
var ref;
|
|
302
|
-
let tailwindConfigLocation = _path.default.resolve((ref =
|
|
302
|
+
let tailwindConfigLocation = _path.default.resolve((ref = args1['_'][1]) !== null && ref !== void 0 ? ref : './tailwind.config.js');
|
|
303
303
|
if (_fs.default.existsSync(tailwindConfigLocation)) {
|
|
304
304
|
messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`);
|
|
305
305
|
} else {
|
|
306
|
-
let stubFile = _fs.default.readFileSync(
|
|
306
|
+
let stubFile = _fs.default.readFileSync(args1['--full'] ? _path.default.resolve(__dirname, '../stubs/defaultConfig.stub.js') : _path.default.resolve(__dirname, '../stubs/simpleConfig.stub.js'), 'utf8');
|
|
307
307
|
// Change colors import
|
|
308
308
|
stubFile = stubFile.replace('../colors', 'tailwindcss/colors');
|
|
309
309
|
_fs.default.writeFileSync(tailwindConfigLocation, stubFile, 'utf8');
|
|
310
310
|
messages.push(`Created Tailwind CSS config file: ${_path.default.basename(tailwindConfigLocation)}`);
|
|
311
311
|
}
|
|
312
|
-
if (
|
|
312
|
+
if (args1['--postcss']) {
|
|
313
313
|
let postcssConfigLocation = _path.default.resolve('./postcss.config.js');
|
|
314
314
|
if (_fs.default.existsSync(postcssConfigLocation)) {
|
|
315
315
|
messages.push(`${_path.default.basename(postcssConfigLocation)} already exists.`);
|
|
@@ -327,27 +327,27 @@ function init() {
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
async function build() {
|
|
330
|
-
let input =
|
|
331
|
-
let output =
|
|
332
|
-
let shouldWatch =
|
|
333
|
-
let includePostCss =
|
|
330
|
+
let input = args1['--input'];
|
|
331
|
+
let output = args1['--output'];
|
|
332
|
+
let shouldWatch = args1['--watch'];
|
|
333
|
+
let includePostCss = args1['--postcss'];
|
|
334
334
|
// TODO: Deprecate this in future versions
|
|
335
|
-
if (!input &&
|
|
335
|
+
if (!input && args1['_'][1]) {
|
|
336
336
|
console.error('[deprecation] Running tailwindcss without -i, please provide an input file.');
|
|
337
|
-
input =
|
|
337
|
+
input = args1['--input'] = args1['_'][1];
|
|
338
338
|
}
|
|
339
339
|
if (input && !_fs.default.existsSync(input = _path.default.resolve(input))) {
|
|
340
|
-
console.error(`Specified input file ${
|
|
340
|
+
console.error(`Specified input file ${args1['--input']} does not exist.`);
|
|
341
341
|
process.exit(9);
|
|
342
342
|
}
|
|
343
|
-
if (
|
|
344
|
-
console.error(`Specified config file ${
|
|
343
|
+
if (args1['--config'] && !_fs.default.existsSync(args1['--config'] = _path.default.resolve(args1['--config']))) {
|
|
344
|
+
console.error(`Specified config file ${args1['--config']} does not exist.`);
|
|
345
345
|
process.exit(9);
|
|
346
346
|
}
|
|
347
|
-
let configPath =
|
|
347
|
+
let configPath = args1['--config'] ? args1['--config'] : ((defaultPath)=>_fs.default.existsSync(defaultPath) ? defaultPath : null
|
|
348
348
|
)(_path.default.resolve('./tailwind.config.js'));
|
|
349
349
|
async function loadPostCssPlugins() {
|
|
350
|
-
let customPostCssPath = typeof
|
|
350
|
+
let customPostCssPath = typeof args1['--postcss'] === 'string' ? args1['--postcss'] : undefined;
|
|
351
351
|
let { plugins: configPlugins } = customPostCssPath ? await (async ()=>{
|
|
352
352
|
let file = _path.default.resolve(customPostCssPath);
|
|
353
353
|
// Implementation, see: https://unpkg.com/browse/postcss-load-config@3.0.1/src/index.js
|
|
@@ -386,17 +386,17 @@ async function build() {
|
|
|
386
386
|
let config = configPath ? require(configPath) : {
|
|
387
387
|
};
|
|
388
388
|
let resolvedConfig = (0, _resolveConfig).default(config);
|
|
389
|
-
if (
|
|
389
|
+
if (args1['--purge']) {
|
|
390
390
|
_log.default.warn('purge-flag-deprecated', [
|
|
391
391
|
'The `--purge` flag has been deprecated.',
|
|
392
392
|
'Please use `--content` instead.',
|
|
393
393
|
]);
|
|
394
|
-
if (!
|
|
395
|
-
|
|
394
|
+
if (!args1['--content']) {
|
|
395
|
+
args1['--content'] = args1['--purge'];
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
if (
|
|
399
|
-
resolvedConfig.content.files =
|
|
398
|
+
if (args1['--content']) {
|
|
399
|
+
resolvedConfig.content.files = args1['--content'].split(/(?<!{[^}]+),/);
|
|
400
400
|
}
|
|
401
401
|
return resolvedConfig;
|
|
402
402
|
}
|
|
@@ -457,9 +457,9 @@ async function build() {
|
|
|
457
457
|
let plugins = [
|
|
458
458
|
...beforePlugins,
|
|
459
459
|
tailwindPlugin,
|
|
460
|
-
!
|
|
460
|
+
!args1['--minify'] && formatNodes,
|
|
461
461
|
...afterPlugins,
|
|
462
|
-
!
|
|
462
|
+
!args1['--no-autoprefixer'] && (()=>{
|
|
463
463
|
// Try to load a local `autoprefixer` version first
|
|
464
464
|
try {
|
|
465
465
|
return require('autoprefixer');
|
|
@@ -467,7 +467,7 @@ async function build() {
|
|
|
467
467
|
}
|
|
468
468
|
return (0, _indexJs).lazyAutoprefixer();
|
|
469
469
|
})(),
|
|
470
|
-
|
|
470
|
+
args1['--minify'] && (()=>{
|
|
471
471
|
let options = {
|
|
472
472
|
preset: [
|
|
473
473
|
'default',
|
|
@@ -510,8 +510,8 @@ async function build() {
|
|
|
510
510
|
console.error('Done in', (end - start) / BigInt(1000000) + 'ms.');
|
|
511
511
|
});
|
|
512
512
|
}
|
|
513
|
-
let
|
|
514
|
-
return processCSS(
|
|
513
|
+
let css1 = input ? _fs.default.readFileSync(_path.default.resolve(input), 'utf8') : '@tailwind base; @tailwind components; @tailwind utilities';
|
|
514
|
+
return processCSS(css1);
|
|
515
515
|
}
|
|
516
516
|
let context = null;
|
|
517
517
|
async function startWatcher() {
|
|
@@ -521,8 +521,8 @@ async function build() {
|
|
|
521
521
|
let watcher = null;
|
|
522
522
|
function refreshConfig() {
|
|
523
523
|
env.DEBUG && console.time('Module dependencies');
|
|
524
|
-
for (let
|
|
525
|
-
delete require.cache[require.resolve(
|
|
524
|
+
for (let file1 of configDependencies){
|
|
525
|
+
delete require.cache[require.resolve(file1)];
|
|
526
526
|
}
|
|
527
527
|
if (configPath) {
|
|
528
528
|
configDependencies = (0, _getModuleDependencies).default(configPath).map(({ file })=>file
|
|
@@ -541,9 +541,9 @@ async function build() {
|
|
|
541
541
|
let plugins = [
|
|
542
542
|
...beforePlugins,
|
|
543
543
|
'__TAILWIND_PLUGIN_POSITION__',
|
|
544
|
-
!
|
|
544
|
+
!args1['--minify'] && formatNodes,
|
|
545
545
|
...afterPlugins,
|
|
546
|
-
!
|
|
546
|
+
!args1['--no-autoprefixer'] && (()=>{
|
|
547
547
|
// Try to load a local `autoprefixer` version first
|
|
548
548
|
try {
|
|
549
549
|
return require('autoprefixer');
|
|
@@ -551,7 +551,7 @@ async function build() {
|
|
|
551
551
|
}
|
|
552
552
|
return (0, _indexJs).lazyAutoprefixer();
|
|
553
553
|
})(),
|
|
554
|
-
|
|
554
|
+
args1['--minify'] && (()=>{
|
|
555
555
|
let options = {
|
|
556
556
|
preset: [
|
|
557
557
|
'default',
|
|
@@ -636,18 +636,18 @@ async function build() {
|
|
|
636
636
|
}
|
|
637
637
|
});
|
|
638
638
|
}
|
|
639
|
-
let
|
|
640
|
-
let result1 = await processCSS(
|
|
639
|
+
let css2 = input ? _fs.default.readFileSync(_path.default.resolve(input), 'utf8') : '@tailwind base; @tailwind components; @tailwind utilities';
|
|
640
|
+
let result1 = await processCSS(css2);
|
|
641
641
|
env.DEBUG && console.timeEnd('Finished in');
|
|
642
642
|
return result1;
|
|
643
643
|
}
|
|
644
|
-
let
|
|
644
|
+
let config1 = refreshConfig(configPath);
|
|
645
645
|
if (input) {
|
|
646
646
|
contextDependencies.add(_path.default.resolve(input));
|
|
647
647
|
}
|
|
648
648
|
watcher = _chokidar.default.watch([
|
|
649
649
|
...contextDependencies,
|
|
650
|
-
...extractFileGlobs(
|
|
650
|
+
...extractFileGlobs(config1)
|
|
651
651
|
], {
|
|
652
652
|
ignoreInitial: true,
|
|
653
653
|
awaitWriteFinish: process.platform === 'win32' ? {
|
|
@@ -660,16 +660,16 @@ async function build() {
|
|
|
660
660
|
if (contextDependencies.has(file)) {
|
|
661
661
|
env.DEBUG && console.time('Resolve config');
|
|
662
662
|
context = null;
|
|
663
|
-
|
|
663
|
+
config1 = refreshConfig(configPath);
|
|
664
664
|
env.DEBUG && console.timeEnd('Resolve config');
|
|
665
665
|
env.DEBUG && console.time('Watch new files');
|
|
666
|
-
let globs = extractFileGlobs(
|
|
666
|
+
let globs = extractFileGlobs(config1);
|
|
667
667
|
watcher.add(configDependencies);
|
|
668
668
|
watcher.add(globs);
|
|
669
669
|
env.DEBUG && console.timeEnd('Watch new files');
|
|
670
670
|
chain = chain.then(async ()=>{
|
|
671
|
-
changedContent.push(...getChangedContent(
|
|
672
|
-
await rebuild(
|
|
671
|
+
changedContent.push(...getChangedContent(config1));
|
|
672
|
+
await rebuild(config1);
|
|
673
673
|
});
|
|
674
674
|
} else {
|
|
675
675
|
chain = chain.then(async ()=>{
|
|
@@ -677,7 +677,7 @@ async function build() {
|
|
|
677
677
|
content: _fs.default.readFileSync(_path.default.resolve(file), 'utf8'),
|
|
678
678
|
extension: _path.default.extname(file).slice(1)
|
|
679
679
|
});
|
|
680
|
-
await rebuild(
|
|
680
|
+
await rebuild(config1);
|
|
681
681
|
});
|
|
682
682
|
}
|
|
683
683
|
});
|
|
@@ -687,12 +687,12 @@ async function build() {
|
|
|
687
687
|
content: _fs.default.readFileSync(_path.default.resolve(file), 'utf8'),
|
|
688
688
|
extension: _path.default.extname(file).slice(1)
|
|
689
689
|
});
|
|
690
|
-
await rebuild(
|
|
690
|
+
await rebuild(config1);
|
|
691
691
|
});
|
|
692
692
|
});
|
|
693
693
|
chain = chain.then(()=>{
|
|
694
|
-
changedContent.push(...getChangedContent(
|
|
695
|
-
return rebuild(
|
|
694
|
+
changedContent.push(...getChangedContent(config1));
|
|
695
|
+
return rebuild(config1);
|
|
696
696
|
});
|
|
697
697
|
}
|
|
698
698
|
if (shouldWatch) {
|
package/lib/constants.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports.
|
|
5
|
+
exports.defaultPostCssConfigStubFile = exports.simpleConfigStubFile = exports.defaultConfigStubFile = exports.supportedPostCssConfigFile = exports.supportedConfigFiles = exports.cjsPostCssConfigFile = exports.cjsConfigFile = exports.defaultPostCssConfigFile = exports.defaultConfigFile = exports.cli = void 0;
|
|
6
6
|
var _path = _interopRequireDefault(require("path"));
|
|
7
7
|
function _interopRequireDefault(obj) {
|
|
8
8
|
return obj && obj.__esModule ? obj : {
|
package/lib/corePluginList.js
CHANGED
|
@@ -135,7 +135,11 @@ var _default = [
|
|
|
135
135
|
"backgroundBlendMode",
|
|
136
136
|
"mixBlendMode",
|
|
137
137
|
"boxShadow",
|
|
138
|
-
"
|
|
138
|
+
"boxShadowColor",
|
|
139
|
+
"outlineStyle",
|
|
140
|
+
"outlineWidth",
|
|
141
|
+
"outlineOffset",
|
|
142
|
+
"outlineColor",
|
|
139
143
|
"ringWidth",
|
|
140
144
|
"ringColor",
|
|
141
145
|
"ringOpacity",
|
package/lib/corePlugins.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports.
|
|
5
|
+
exports.corePlugins = exports.variantPlugins = void 0;
|
|
6
6
|
var _fs = _interopRequireDefault(require("fs"));
|
|
7
7
|
var path = _interopRequireWildcard(require("path"));
|
|
8
8
|
var _postcss = _interopRequireDefault(require("postcss"));
|
|
@@ -16,6 +16,7 @@ var _isPlainObject = _interopRequireDefault(require("./util/isPlainObject"));
|
|
|
16
16
|
var _transformThemeValue = _interopRequireDefault(require("./util/transformThemeValue"));
|
|
17
17
|
var _packageJson = require("../package.json");
|
|
18
18
|
var _log = _interopRequireDefault(require("./util/log"));
|
|
19
|
+
var _parseBoxShadowValue = require("./util/parseBoxShadowValue");
|
|
19
20
|
function _interopRequireDefault(obj) {
|
|
20
21
|
return obj && obj.__esModule ? obj : {
|
|
21
22
|
default: obj
|
|
@@ -57,6 +58,7 @@ let variantPlugins = {
|
|
|
57
58
|
'&::selection'
|
|
58
59
|
]);
|
|
59
60
|
addVariant('file', '&::file-selector-button');
|
|
61
|
+
addVariant('placeholder', '&::placeholder');
|
|
60
62
|
addVariant('before', ({ container })=>{
|
|
61
63
|
container.walkRules((rule)=>{
|
|
62
64
|
let foundContent = false;
|
|
@@ -192,6 +194,9 @@ let variantPlugins = {
|
|
|
192
194
|
addVariant('dark', '@media (prefers-color-scheme: dark)');
|
|
193
195
|
}
|
|
194
196
|
},
|
|
197
|
+
printVariant: ({ addVariant })=>{
|
|
198
|
+
addVariant('print', '@media print');
|
|
199
|
+
},
|
|
195
200
|
screenVariants: ({ theme , addVariant })=>{
|
|
196
201
|
for(let screen in theme('screens')){
|
|
197
202
|
let size = theme('screens')[screen];
|
|
@@ -201,7 +206,7 @@ let variantPlugins = {
|
|
|
201
206
|
}
|
|
202
207
|
};
|
|
203
208
|
exports.variantPlugins = variantPlugins;
|
|
204
|
-
let
|
|
209
|
+
let corePlugins1 = {
|
|
205
210
|
preflight: ({ addBase })=>{
|
|
206
211
|
let preflightStyles = _postcss.default.parse(_fs.default.readFileSync(path.join(__dirname, './css/preflight.css'), 'utf8'));
|
|
207
212
|
addBase([
|
|
@@ -212,8 +217,8 @@ let corePlugins = {
|
|
|
212
217
|
]);
|
|
213
218
|
},
|
|
214
219
|
container: (()=>{
|
|
215
|
-
function extractMinWidths(
|
|
216
|
-
return Object.values(
|
|
220
|
+
function extractMinWidths(breakpoints1) {
|
|
221
|
+
return Object.values(breakpoints1 !== null && breakpoints1 !== void 0 ? breakpoints1 : {
|
|
217
222
|
}).flatMap((breakpoints)=>{
|
|
218
223
|
if (typeof breakpoints === 'string') {
|
|
219
224
|
breakpoints = {
|
|
@@ -986,8 +991,8 @@ let corePlugins = {
|
|
|
986
991
|
];
|
|
987
992
|
}));
|
|
988
993
|
matchUtilities({
|
|
989
|
-
animate: (
|
|
990
|
-
let animations = (0, _parseAnimationValue).default(
|
|
994
|
+
animate: (value1)=>{
|
|
995
|
+
let animations = (0, _parseAnimationValue).default(value1);
|
|
991
996
|
return [
|
|
992
997
|
...animations.flatMap((animation)=>keyframes[animation.name]
|
|
993
998
|
),
|
|
@@ -2992,38 +2997,115 @@ let corePlugins = {
|
|
|
2992
2997
|
'@defaults box-shadow': {
|
|
2993
2998
|
'--tw-ring-offset-shadow': '0 0 #0000',
|
|
2994
2999
|
'--tw-ring-shadow': '0 0 #0000',
|
|
2995
|
-
'--tw-shadow': '0 0 #0000'
|
|
3000
|
+
'--tw-shadow': '0 0 #0000',
|
|
3001
|
+
'--tw-shadow-colored': '0 0 #0000'
|
|
2996
3002
|
}
|
|
2997
3003
|
});
|
|
2998
3004
|
matchUtilities({
|
|
2999
3005
|
shadow: (value)=>{
|
|
3000
3006
|
value = transformValue(value);
|
|
3007
|
+
let ast = (0, _parseBoxShadowValue).parseBoxShadowValue(value);
|
|
3008
|
+
for (let shadow of ast){
|
|
3009
|
+
// Don't override color if the whole shadow is a variable
|
|
3010
|
+
if (!shadow.valid) {
|
|
3011
|
+
continue;
|
|
3012
|
+
}
|
|
3013
|
+
shadow.color = 'var(--tw-shadow-color)';
|
|
3014
|
+
}
|
|
3001
3015
|
return {
|
|
3002
3016
|
'@defaults box-shadow': {
|
|
3003
3017
|
},
|
|
3004
3018
|
'--tw-shadow': value === 'none' ? '0 0 #0000' : value,
|
|
3019
|
+
'--tw-shadow-colored': value === 'none' ? '0 0 #0000' : (0, _parseBoxShadowValue).formatBoxShadowValue(ast),
|
|
3005
3020
|
'box-shadow': defaultBoxShadow
|
|
3006
3021
|
};
|
|
3007
3022
|
}
|
|
3008
3023
|
}, {
|
|
3009
|
-
values: theme('boxShadow')
|
|
3024
|
+
values: theme('boxShadow'),
|
|
3025
|
+
type: [
|
|
3026
|
+
'shadow'
|
|
3027
|
+
]
|
|
3010
3028
|
});
|
|
3011
3029
|
};
|
|
3012
3030
|
})(),
|
|
3013
|
-
|
|
3031
|
+
boxShadowColor: ({ matchUtilities , theme })=>{
|
|
3032
|
+
matchUtilities({
|
|
3033
|
+
shadow: (value)=>{
|
|
3034
|
+
return {
|
|
3035
|
+
'--tw-shadow-color': (0, _toColorValue).default(value),
|
|
3036
|
+
'--tw-shadow': 'var(--tw-shadow-colored)'
|
|
3037
|
+
};
|
|
3038
|
+
}
|
|
3039
|
+
}, {
|
|
3040
|
+
values: (0, _flattenColorPalette).default(theme('boxShadowColor')),
|
|
3041
|
+
type: [
|
|
3042
|
+
'color'
|
|
3043
|
+
]
|
|
3044
|
+
});
|
|
3045
|
+
},
|
|
3046
|
+
outlineStyle: ({ addUtilities })=>{
|
|
3047
|
+
addUtilities({
|
|
3048
|
+
'.outline-none': {
|
|
3049
|
+
outline: '2px solid transparent',
|
|
3050
|
+
'outline-offset': '2px'
|
|
3051
|
+
},
|
|
3052
|
+
'.outline': {
|
|
3053
|
+
'outline-style': 'solid'
|
|
3054
|
+
},
|
|
3055
|
+
'.outline-dashed': {
|
|
3056
|
+
'outline-style': 'dashed'
|
|
3057
|
+
},
|
|
3058
|
+
'.outline-dotted': {
|
|
3059
|
+
'outline-style': 'dotted'
|
|
3060
|
+
},
|
|
3061
|
+
'.outline-double': {
|
|
3062
|
+
'outline-style': 'double'
|
|
3063
|
+
},
|
|
3064
|
+
'.outline-hidden': {
|
|
3065
|
+
'outline-style': 'hidden'
|
|
3066
|
+
}
|
|
3067
|
+
});
|
|
3068
|
+
},
|
|
3069
|
+
outlineWidth: (0, _createUtilityPlugin).default('outlineWidth', [
|
|
3070
|
+
[
|
|
3071
|
+
'outline',
|
|
3072
|
+
[
|
|
3073
|
+
'outline-width'
|
|
3074
|
+
]
|
|
3075
|
+
]
|
|
3076
|
+
], {
|
|
3077
|
+
type: [
|
|
3078
|
+
'length',
|
|
3079
|
+
'number',
|
|
3080
|
+
'percentage'
|
|
3081
|
+
]
|
|
3082
|
+
}),
|
|
3083
|
+
outlineOffset: (0, _createUtilityPlugin).default('outlineOffset', [
|
|
3084
|
+
[
|
|
3085
|
+
'outline-offset',
|
|
3086
|
+
[
|
|
3087
|
+
'outline-offset'
|
|
3088
|
+
]
|
|
3089
|
+
]
|
|
3090
|
+
], {
|
|
3091
|
+
type: [
|
|
3092
|
+
'length',
|
|
3093
|
+
'number',
|
|
3094
|
+
'percentage'
|
|
3095
|
+
]
|
|
3096
|
+
}),
|
|
3097
|
+
outlineColor: ({ matchUtilities , theme })=>{
|
|
3014
3098
|
matchUtilities({
|
|
3015
3099
|
outline: (value)=>{
|
|
3016
|
-
value = Array.isArray(value) ? value : value.split(',');
|
|
3017
|
-
let [outline, outlineOffset = '0'] = Array.isArray(value) ? value : [
|
|
3018
|
-
value
|
|
3019
|
-
];
|
|
3020
3100
|
return {
|
|
3021
|
-
outline,
|
|
3022
|
-
'outline-offset': outlineOffset
|
|
3101
|
+
'outline-color': (0, _toColorValue).default(value)
|
|
3023
3102
|
};
|
|
3024
3103
|
}
|
|
3025
3104
|
}, {
|
|
3026
|
-
values: theme('
|
|
3105
|
+
values: (0, _flattenColorPalette).default(theme('outlineColor')),
|
|
3106
|
+
type: [
|
|
3107
|
+
'color'
|
|
3108
|
+
]
|
|
3027
3109
|
});
|
|
3028
3110
|
},
|
|
3029
3111
|
ringWidth: ({ matchUtilities , addBase , addUtilities , theme })=>{
|
|
@@ -3037,7 +3119,8 @@ let corePlugins = {
|
|
|
3037
3119
|
'--tw-ring-color': ringColorDefault,
|
|
3038
3120
|
'--tw-ring-offset-shadow': '0 0 #0000',
|
|
3039
3121
|
'--tw-ring-shadow': '0 0 #0000',
|
|
3040
|
-
'--tw-shadow': '0 0 #0000'
|
|
3122
|
+
'--tw-shadow': '0 0 #0000',
|
|
3123
|
+
'--tw-shadow-colored': '0 0 #0000'
|
|
3041
3124
|
}
|
|
3042
3125
|
});
|
|
3043
3126
|
matchUtilities({
|
|
@@ -3507,4 +3590,4 @@ let corePlugins = {
|
|
|
3507
3590
|
],
|
|
3508
3591
|
])
|
|
3509
3592
|
};
|
|
3510
|
-
exports.corePlugins =
|
|
3593
|
+
exports.corePlugins = corePlugins1;
|
package/lib/featureFlags.js
CHANGED
|
@@ -28,9 +28,9 @@ function flagEnabled(config, flag) {
|
|
|
28
28
|
return config.future === 'all' || ((ref2 = (ref1 = config === null || config === void 0 ? void 0 : (ref = config.future) === null || ref === void 0 ? void 0 : ref[flag]) !== null && ref1 !== void 0 ? ref1 : defaults[flag]) !== null && ref2 !== void 0 ? ref2 : false);
|
|
29
29
|
}
|
|
30
30
|
if (featureFlags.experimental.includes(flag)) {
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
return config.experimental === 'all' || ((
|
|
31
|
+
var ref3;
|
|
32
|
+
var ref4, ref5;
|
|
33
|
+
return config.experimental === 'all' || ((ref5 = (ref4 = config === null || config === void 0 ? void 0 : (ref3 = config.experimental) === null || ref3 === void 0 ? void 0 : ref3[flag]) !== null && ref4 !== void 0 ? ref4 : defaults[flag]) !== null && ref5 !== void 0 ? ref5 : false);
|
|
34
34
|
}
|
|
35
35
|
return false;
|
|
36
36
|
}
|