tailwindcss 3.0.0-alpha.1 → 3.0.2
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/colors.js +2 -1
- package/defaultConfig.js +2 -1
- package/defaultTheme.js +2 -1
- package/lib/cli.js +39 -35
- package/lib/constants.js +1 -1
- package/lib/corePluginList.js +10 -1
- package/lib/corePlugins.js +393 -259
- package/lib/css/preflight.css +14 -1
- package/lib/featureFlags.js +12 -7
- package/lib/lib/collapseDuplicateDeclarations.js +29 -0
- package/lib/lib/detectNesting.js +17 -2
- package/lib/lib/evaluateTailwindFunctions.js +9 -5
- package/lib/lib/expandApplyAtRules.js +26 -9
- package/lib/lib/expandTailwindAtRules.js +4 -1
- package/lib/lib/generateRules.js +151 -19
- package/lib/lib/resolveDefaultsAtRules.js +67 -56
- package/lib/lib/setupContextUtils.js +80 -80
- package/lib/lib/setupWatchingContext.js +5 -1
- package/lib/lib/sharedState.js +2 -2
- package/lib/lib/substituteScreenAtRules.js +7 -4
- package/lib/processTailwindFeatures.js +4 -0
- package/lib/util/buildMediaQuery.js +13 -24
- package/lib/util/createUtilityPlugin.js +5 -5
- package/lib/util/dataTypes.js +38 -7
- package/lib/util/formatVariantSelector.js +186 -0
- package/lib/util/isValidArbitraryValue.js +64 -0
- package/lib/util/nameClass.js +2 -1
- package/lib/util/negateValue.js +3 -1
- package/lib/util/normalizeConfig.js +22 -8
- package/lib/util/normalizeScreens.js +61 -0
- package/lib/util/parseBoxShadowValue.js +77 -0
- package/lib/util/pluginUtils.js +62 -158
- package/lib/util/prefixSelector.js +1 -3
- package/lib/util/resolveConfig.js +17 -13
- package/lib/util/transformThemeValue.js +23 -13
- package/package.json +15 -15
- package/peers/index.js +4456 -5450
- package/plugin.js +2 -1
- package/resolveConfig.js +2 -1
- package/src/.DS_Store +0 -0
- package/src/cli.js +9 -2
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +392 -404
- package/src/css/preflight.css +14 -1
- package/src/featureFlags.js +14 -4
- package/src/lib/collapseDuplicateDeclarations.js +28 -0
- package/src/lib/detectNesting.js +22 -3
- package/src/lib/evaluateTailwindFunctions.js +5 -2
- package/src/lib/expandApplyAtRules.js +29 -2
- package/src/lib/expandTailwindAtRules.js +5 -2
- package/src/lib/generateRules.js +155 -11
- package/src/lib/resolveDefaultsAtRules.js +67 -50
- package/src/lib/setupContextUtils.js +77 -67
- package/src/lib/setupWatchingContext.js +7 -0
- package/src/lib/sharedState.js +1 -1
- package/src/lib/substituteScreenAtRules.js +6 -3
- package/src/processTailwindFeatures.js +5 -0
- package/src/util/buildMediaQuery.js +14 -18
- package/src/util/createUtilityPlugin.js +2 -2
- package/src/util/dataTypes.js +43 -11
- package/src/util/formatVariantSelector.js +196 -0
- package/src/util/isValidArbitraryValue.js +61 -0
- package/src/util/nameClass.js +2 -2
- package/src/util/negateValue.js +4 -2
- package/src/util/normalizeConfig.js +17 -1
- package/src/util/normalizeScreens.js +45 -0
- package/src/util/parseBoxShadowValue.js +71 -0
- package/src/util/pluginUtils.js +50 -146
- package/src/util/prefixSelector.js +1 -4
- package/src/util/resolveConfig.js +7 -1
- package/src/util/transformThemeValue.js +22 -7
- package/stubs/defaultConfig.stub.js +118 -58
- package/CHANGELOG.md +0 -1759
package/colors.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
let colors = require('./lib/public/colors')
|
|
2
|
+
module.exports = (colors.__esModule ? colors : { default: colors }).default
|
package/defaultConfig.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
let defaultConfig = require('./lib/public/default-config')
|
|
2
|
+
module.exports = (defaultConfig.__esModule ? defaultConfig : { default: defaultConfig }).default
|
package/defaultTheme.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
let defaultTheme = require('./lib/public/default-theme')
|
|
2
|
+
module.exports = (defaultTheme.__esModule ? defaultTheme : { default: defaultTheme }).default
|
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) {
|
|
@@ -40,7 +40,7 @@ function formatNodes(root) {
|
|
|
40
40
|
root.first.raws.before = '';
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
function help({ message , usage , commands , options }) {
|
|
43
|
+
function help({ message , usage , commands: commands1 , options }) {
|
|
44
44
|
let indent = 2;
|
|
45
45
|
// Render header
|
|
46
46
|
console.log();
|
|
@@ -61,11 +61,11 @@ function help({ message , usage , commands , options }) {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
// Render commands
|
|
64
|
-
if (
|
|
64
|
+
if (commands1 && commands1.length > 0) {
|
|
65
65
|
console.log();
|
|
66
66
|
console.log('Commands:');
|
|
67
|
-
for (let
|
|
68
|
-
console.log(' '.repeat(indent),
|
|
67
|
+
for (let command1 of commands1){
|
|
68
|
+
console.log(' '.repeat(indent), command1);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
// Render options
|
|
@@ -86,12 +86,12 @@ function help({ message , usage , commands , options }) {
|
|
|
86
86
|
}
|
|
87
87
|
console.log();
|
|
88
88
|
console.log('Options:');
|
|
89
|
-
for (let { flags , description , deprecated } of Object.values(groupedOptions)){
|
|
89
|
+
for (let { flags: flags1 , description , deprecated } of Object.values(groupedOptions)){
|
|
90
90
|
if (deprecated) continue;
|
|
91
|
-
if (
|
|
92
|
-
console.log(' '.repeat(indent + 4 /* 4 = "-i, ".length */ ),
|
|
91
|
+
if (flags1.length === 1) {
|
|
92
|
+
console.log(' '.repeat(indent + 4 /* 4 = "-i, ".length */ ), flags1.slice().reverse().join(', ').padEnd(20, ' '), description);
|
|
93
93
|
} else {
|
|
94
|
-
console.log(' '.repeat(indent),
|
|
94
|
+
console.log(' '.repeat(indent), flags1.slice().reverse().join(', ').padEnd(24, ' '), description);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -187,8 +187,8 @@ 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(commands).filter((
|
|
191
|
-
).map((
|
|
190
|
+
commands: Object.keys(commands).filter((command2)=>command2 !== 'build'
|
|
191
|
+
).map((command3)=>`${command3} [options]`
|
|
192
192
|
),
|
|
193
193
|
options: {
|
|
194
194
|
...commands.build.args,
|
|
@@ -210,8 +210,8 @@ if (commands[command] === undefined) {
|
|
|
210
210
|
usage: [
|
|
211
211
|
'tailwindcss <command> [options]'
|
|
212
212
|
],
|
|
213
|
-
commands: Object.keys(commands).filter((
|
|
214
|
-
).map((
|
|
213
|
+
commands: Object.keys(commands).filter((command4)=>command4 !== 'build'
|
|
214
|
+
).map((command5)=>`${command5} [options]`
|
|
215
215
|
),
|
|
216
216
|
options: sharedFlags
|
|
217
217
|
});
|
|
@@ -247,16 +247,16 @@ let args = (()=>{
|
|
|
247
247
|
handler = flags[handler];
|
|
248
248
|
}
|
|
249
249
|
if (!handler) continue;
|
|
250
|
-
let
|
|
250
|
+
let args1 = [];
|
|
251
251
|
let offset = i + 1;
|
|
252
252
|
// Parse args for current flag
|
|
253
253
|
while(result['_'][offset] && !result['_'][offset].startsWith('-')){
|
|
254
|
-
|
|
254
|
+
args1.push(result['_'][offset++]);
|
|
255
255
|
}
|
|
256
256
|
// Cleanup manually parsed flags + args
|
|
257
|
-
result['_'].splice(i, 1 +
|
|
257
|
+
result['_'].splice(i, 1 + args1.length);
|
|
258
258
|
// Set the resolved value in the `result` object
|
|
259
|
-
result[flagName] = handler.type(
|
|
259
|
+
result[flagName] = handler.type(args1.length === 0 ? undefined : args1.length === 1 ? args1[0] : args1, flagName);
|
|
260
260
|
}
|
|
261
261
|
// Ensure that the `command` is always the first argument in the `args`.
|
|
262
262
|
// This is important so that we don't have to check if a default command
|
|
@@ -396,7 +396,7 @@ async function build() {
|
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
if (args['--content']) {
|
|
399
|
-
resolvedConfig.content = args['--content'].split(/(?<!{[^}]+),/);
|
|
399
|
+
resolvedConfig.content.files = args['--content'].split(/(?<!{[^}]+),/);
|
|
400
400
|
}
|
|
401
401
|
return resolvedConfig;
|
|
402
402
|
}
|
|
@@ -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
|
|
@@ -636,36 +636,40 @@ 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
|
-
ignoreInitial: true
|
|
652
|
+
ignoreInitial: true,
|
|
653
|
+
awaitWriteFinish: process.platform === 'win32' ? {
|
|
654
|
+
stabilityThreshold: 50,
|
|
655
|
+
pollInterval: 10
|
|
656
|
+
} : false
|
|
653
657
|
});
|
|
654
658
|
let chain = Promise.resolve();
|
|
655
659
|
watcher.on('change', async (file)=>{
|
|
656
660
|
if (contextDependencies.has(file)) {
|
|
657
661
|
env.DEBUG && console.time('Resolve config');
|
|
658
662
|
context = null;
|
|
659
|
-
|
|
663
|
+
config1 = refreshConfig(configPath);
|
|
660
664
|
env.DEBUG && console.timeEnd('Resolve config');
|
|
661
665
|
env.DEBUG && console.time('Watch new files');
|
|
662
|
-
let globs = extractFileGlobs(
|
|
666
|
+
let globs = extractFileGlobs(config1);
|
|
663
667
|
watcher.add(configDependencies);
|
|
664
668
|
watcher.add(globs);
|
|
665
669
|
env.DEBUG && console.timeEnd('Watch new files');
|
|
666
670
|
chain = chain.then(async ()=>{
|
|
667
|
-
changedContent.push(...getChangedContent(
|
|
668
|
-
await rebuild(
|
|
671
|
+
changedContent.push(...getChangedContent(config1));
|
|
672
|
+
await rebuild(config1);
|
|
669
673
|
});
|
|
670
674
|
} else {
|
|
671
675
|
chain = chain.then(async ()=>{
|
|
@@ -673,7 +677,7 @@ async function build() {
|
|
|
673
677
|
content: _fs.default.readFileSync(_path.default.resolve(file), 'utf8'),
|
|
674
678
|
extension: _path.default.extname(file).slice(1)
|
|
675
679
|
});
|
|
676
|
-
await rebuild(
|
|
680
|
+
await rebuild(config1);
|
|
677
681
|
});
|
|
678
682
|
}
|
|
679
683
|
});
|
|
@@ -683,12 +687,12 @@ async function build() {
|
|
|
683
687
|
content: _fs.default.readFileSync(_path.default.resolve(file), 'utf8'),
|
|
684
688
|
extension: _path.default.extname(file).slice(1)
|
|
685
689
|
});
|
|
686
|
-
await rebuild(
|
|
690
|
+
await rebuild(config1);
|
|
687
691
|
});
|
|
688
692
|
});
|
|
689
693
|
chain = chain.then(()=>{
|
|
690
|
-
changedContent.push(...getChangedContent(
|
|
691
|
-
return rebuild(
|
|
694
|
+
changedContent.push(...getChangedContent(config1));
|
|
695
|
+
return rebuild(config1);
|
|
692
696
|
});
|
|
693
697
|
}
|
|
694
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
|
@@ -35,6 +35,7 @@ var _default = [
|
|
|
35
35
|
"flex",
|
|
36
36
|
"flexShrink",
|
|
37
37
|
"flexGrow",
|
|
38
|
+
"flexBasis",
|
|
38
39
|
"tableLayout",
|
|
39
40
|
"borderCollapse",
|
|
40
41
|
"transformOrigin",
|
|
@@ -124,6 +125,10 @@ var _default = [
|
|
|
124
125
|
"textColor",
|
|
125
126
|
"textOpacity",
|
|
126
127
|
"textDecoration",
|
|
128
|
+
"textDecorationColor",
|
|
129
|
+
"textDecorationStyle",
|
|
130
|
+
"textDecorationThickness",
|
|
131
|
+
"textUnderlineOffset",
|
|
127
132
|
"fontSmoothing",
|
|
128
133
|
"placeholderColor",
|
|
129
134
|
"placeholderOpacity",
|
|
@@ -133,7 +138,11 @@ var _default = [
|
|
|
133
138
|
"backgroundBlendMode",
|
|
134
139
|
"mixBlendMode",
|
|
135
140
|
"boxShadow",
|
|
136
|
-
"
|
|
141
|
+
"boxShadowColor",
|
|
142
|
+
"outlineStyle",
|
|
143
|
+
"outlineWidth",
|
|
144
|
+
"outlineOffset",
|
|
145
|
+
"outlineColor",
|
|
137
146
|
"ringWidth",
|
|
138
147
|
"ringColor",
|
|
139
148
|
"ringOpacity",
|