tailwindcss 0.0.0-insiders.e602a3d → 0.0.0-insiders.e6e24b8
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 +94 -1
- package/lib/cli.js +76 -75
- package/lib/constants.js +1 -1
- package/lib/corePluginList.js +15 -1
- package/lib/corePlugins.js +655 -272
- package/lib/css/preflight.css +14 -1
- package/lib/featureFlags.js +12 -9
- 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 +7 -7
- package/lib/lib/expandTailwindAtRules.js +17 -27
- package/lib/lib/generateRules.js +206 -27
- package/lib/lib/normalizeTailwindDirectives.js +3 -2
- package/lib/lib/resolveDefaultsAtRules.js +44 -47
- package/lib/lib/setupContextUtils.js +219 -194
- package/lib/lib/setupTrackingContext.js +9 -6
- package/lib/lib/setupWatchingContext.js +10 -6
- package/lib/lib/sharedState.js +2 -12
- package/lib/lib/substituteScreenAtRules.js +7 -4
- package/lib/processTailwindFeatures.js +5 -1
- package/lib/public/colors.js +6 -9
- 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/log.js +30 -18
- package/lib/util/nameClass.js +2 -1
- package/lib/util/negateValue.js +3 -1
- package/lib/util/normalizeConfig.js +208 -0
- package/lib/util/normalizeScreens.js +61 -0
- package/lib/util/parseBoxShadowValue.js +77 -0
- package/lib/util/parseDependency.js +3 -0
- package/lib/util/pluginUtils.js +68 -160
- package/lib/util/prefixSelector.js +1 -3
- package/lib/util/resolveConfig.js +18 -77
- package/lib/util/transformThemeValue.js +23 -13
- package/lib/util/withAlphaVariable.js +29 -14
- package/package.json +14 -14
- package/peers/index.js +4470 -5323
- package/scripts/create-plugin-list.js +2 -2
- package/src/cli.js +27 -18
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +526 -415
- package/src/css/preflight.css +14 -1
- package/src/featureFlags.js +12 -6
- package/src/lib/collapseDuplicateDeclarations.js +28 -0
- package/src/lib/detectNesting.js +22 -3
- package/src/lib/evaluateTailwindFunctions.js +5 -2
- package/src/lib/expandTailwindAtRules.js +18 -30
- package/src/lib/generateRules.js +228 -19
- package/src/lib/normalizeTailwindDirectives.js +3 -2
- package/src/lib/resolveDefaultsAtRules.js +39 -43
- package/src/lib/setupContextUtils.js +207 -176
- package/src/lib/setupTrackingContext.js +8 -8
- package/src/lib/setupWatchingContext.js +11 -7
- package/src/lib/sharedState.js +1 -4
- package/src/lib/substituteScreenAtRules.js +6 -3
- package/src/processTailwindFeatures.js +6 -1
- package/src/public/colors.js +6 -10
- 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/log.js +18 -21
- package/src/util/nameClass.js +2 -2
- package/src/util/negateValue.js +4 -2
- package/src/util/normalizeConfig.js +249 -0
- package/src/util/normalizeScreens.js +45 -0
- package/src/util/parseBoxShadowValue.js +71 -0
- package/src/util/parseDependency.js +4 -0
- package/src/util/pluginUtils.js +59 -147
- package/src/util/prefixSelector.js +1 -4
- package/src/util/resolveConfig.js +11 -64
- package/src/util/transformThemeValue.js +22 -7
- package/src/util/withAlphaVariable.js +13 -8
- package/stubs/defaultConfig.stub.js +155 -89
- package/stubs/simpleConfig.stub.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,62 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Enforce the order of some variants (like `before` and `after`) ([#6018](https://github.com/tailwindlabs/tailwindcss/pull/6018))
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- Add `placeholder` variant ([#6106](https://github.com/tailwindlabs/tailwindcss/pull/6106))
|
|
17
|
+
- Add composable `touch-action` utilities ([#6115](https://github.com/tailwindlabs/tailwindcss/pull/6115))
|
|
18
|
+
- Add support for "arbitrary properties" ([#6161](https://github.com/tailwindlabs/tailwindcss/pull/6161))
|
|
19
|
+
- Add `portrait` and `landscape` variants ([#6046](https://github.com/tailwindlabs/tailwindcss/pull/6046))
|
|
20
|
+
- Add `text-decoration-style`, `text-decoration-thickness`, and `text-underline-offset` utilities ([#6004](https://github.com/tailwindlabs/tailwindcss/pull/6004))
|
|
21
|
+
- Add `menu` reset to preflight ([#6213](https://github.com/tailwindlabs/tailwindcss/pull/6213))
|
|
22
|
+
- Allow `0` as a valid `length` value ([#6233](https://github.com/tailwindlabs/tailwindcss/pull/6233), [#6259](https://github.com/tailwindlabs/tailwindcss/pull/6259))
|
|
23
|
+
- Add CSS functions to data types ([#6258](https://github.com/tailwindlabs/tailwindcss/pull/6258))
|
|
24
|
+
- Support negative values for `scale-*` utilities ([c48e629](https://github.com/tailwindlabs/tailwindcss/commit/c48e629955585ad18dadba9f470fda59cc448ab7))
|
|
25
|
+
- Improve `length` data type, by validating each value individually ([#6283](https://github.com/tailwindlabs/tailwindcss/pull/6283))
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- Deprecate `decoration-slice` and `decoration-break` in favor `box-decoration-slice` and `box-decoration-break` _(non-breaking)_ ([#6004](https://github.com/tailwindlabs/tailwindcss/pull/6004))
|
|
30
|
+
|
|
31
|
+
## [3.0.0-alpha.2] - 2021-11-08
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- Don't use pointer cursor on disabled buttons by default ([#5772](https://github.com/tailwindlabs/tailwindcss/pull/5772))
|
|
36
|
+
- Set default content value in preflight instead of within each before/after utility ([#5820](https://github.com/tailwindlabs/tailwindcss/pull/5820))
|
|
37
|
+
- Remove `prefix` as a function ([#5829](https://github.com/tailwindlabs/tailwindcss/pull/5829))
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- Add `flex-basis` utilities ([#5671](https://github.com/tailwindlabs/tailwindcss/pull/5671))
|
|
42
|
+
- Make negative values a first-class feature ([#5709](https://github.com/tailwindlabs/tailwindcss/pull/5709))
|
|
43
|
+
- Add `fit-content` values for `min/max-width/height` utilities ([#5638](https://github.com/tailwindlabs/tailwindcss/pull/5638))
|
|
44
|
+
- Add `min/max-content` values for `min/max-height` utilities ([#5729](https://github.com/tailwindlabs/tailwindcss/pull/5729))
|
|
45
|
+
- Add all standard `cursor-*` values by default ([#5734](https://github.com/tailwindlabs/tailwindcss/pull/5734))
|
|
46
|
+
- Add `grow-*` and `shrink-*` utilities, deprecate `flex-grow-*` and `flex-shrink-*` ([#5733](https://github.com/tailwindlabs/tailwindcss/pull/5733))
|
|
47
|
+
- Add `text-decoration-color` utilities ([#5760](https://github.com/tailwindlabs/tailwindcss/pull/5760))
|
|
48
|
+
- Add new declarative `addVariant` API ([#5809](https://github.com/tailwindlabs/tailwindcss/pull/5809))
|
|
49
|
+
- Add first-class `print` variant for targeting printed media ([#5885](https://github.com/tailwindlabs/tailwindcss/pull/5885))
|
|
50
|
+
- Add full color palette for `fill-*` and `stroke-*` utilities (#5933[](https://github.com/tailwindlabs/tailwindcss/pull/5933))
|
|
51
|
+
- Add composable API for colored box shadows ([#5979](https://github.com/tailwindlabs/tailwindcss/pull/5979))
|
|
52
|
+
|
|
53
|
+
### Fixed
|
|
54
|
+
|
|
55
|
+
- Configure chokidar's `awaitWriteFinish` setting to avoid occasional stale builds on Windows ([#5774](https://github.com/tailwindlabs/tailwindcss/pull/5774))
|
|
56
|
+
- Fix CLI `--content` option ([#5775](https://github.com/tailwindlabs/tailwindcss/pull/5775))
|
|
57
|
+
- Fix before/after utilities overriding custom content values at larger breakpoints ([#5820](https://github.com/tailwindlabs/tailwindcss/pull/5820))
|
|
58
|
+
- Cleanup duplicate properties ([#5830](https://github.com/tailwindlabs/tailwindcss/pull/5830))
|
|
59
|
+
- Allow `_` inside `url()` when using arbitrary values ([#5853](https://github.com/tailwindlabs/tailwindcss/pull/5853))
|
|
60
|
+
- Prevent crashes when using comments in `@layer` AtRules ([#5854](https://github.com/tailwindlabs/tailwindcss/pull/5854))
|
|
61
|
+
- 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))
|
|
62
|
+
- Ensure `@apply`-ing a utility with multiple definitions works ([#5870](https://github.com/tailwindlabs/tailwindcss/pull/5870))
|
|
63
|
+
|
|
64
|
+
## [3.0.0-alpha.1] - 2021-10-01
|
|
65
|
+
|
|
10
66
|
### Changed
|
|
11
67
|
|
|
12
68
|
- Remove AOT engine, make JIT the default ([#5340](https://github.com/tailwindlabs/tailwindcss/pull/5340))
|
|
@@ -14,21 +70,53 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
14
70
|
- Remove dependency on `modern-normalize`, inline and consolidate with Preflight ([#5358](https://github.com/tailwindlabs/tailwindcss/pull/5358))
|
|
15
71
|
- Enable extended color palette by default with updated color names ([#5384](https://github.com/tailwindlabs/tailwindcss/pull/5384))
|
|
16
72
|
- Move `vertical-align` values to config file instead of hard-coding ([#5487](https://github.com/tailwindlabs/tailwindcss/pull/5487))
|
|
73
|
+
- Rename `overflow-clip` to `text-clip` and `overflow-ellipsis` to `text-ellipsis` ([#5630](https://github.com/tailwindlabs/tailwindcss/pull/5630))
|
|
17
74
|
|
|
18
75
|
### Added
|
|
19
76
|
|
|
20
77
|
- Add native `aspect-ratio` utilities ([#5359](https://github.com/tailwindlabs/tailwindcss/pull/5359))
|
|
21
78
|
- Unify config callback helpers into single object ([#5382](https://github.com/tailwindlabs/tailwindcss/pull/5382))
|
|
22
79
|
- Preserve original color format when adding opacity whenever possible ([#5154](https://github.com/tailwindlabs/tailwindcss/pull/5154))
|
|
80
|
+
- Add `accent-color` utilities ([#5387](https://github.com/tailwindlabs/tailwindcss/pull/5387))
|
|
23
81
|
- Add `scroll-behavior` utilities ([#5388](https://github.com/tailwindlabs/tailwindcss/pull/5388))
|
|
82
|
+
- Add `will-change` utilities ([#5448](https://github.com/tailwindlabs/tailwindcss/pull/5448))
|
|
83
|
+
- Add `text-indent` utilities ([#5449](https://github.com/tailwindlabs/tailwindcss/pull/5449))
|
|
84
|
+
- Add `column` utilities ([#5457](https://github.com/tailwindlabs/tailwindcss/pull/5457))
|
|
24
85
|
- Add `border-hidden` utility ([#5485](https://github.com/tailwindlabs/tailwindcss/pull/5485))
|
|
25
86
|
- Add `align-sub` and `align-super` utilities by default ([#5486](https://github.com/tailwindlabs/tailwindcss/pull/5486))
|
|
26
87
|
- Add `break-before`, `break-inside` and `break-after` utilities ([#5530](https://github.com/tailwindlabs/tailwindcss/pull/5530))
|
|
27
88
|
- Add `file` variant for `::file-selector-button` pseudo element ([#4936](https://github.com/tailwindlabs/tailwindcss/pull/4936))
|
|
89
|
+
- Add comprehensive arbitrary value support ([#5568](https://github.com/tailwindlabs/tailwindcss/pull/5568))
|
|
90
|
+
- Add `touch-action` utilities ([#5603](https://github.com/tailwindlabs/tailwindcss/pull/5603))
|
|
91
|
+
- Add `inherit` to default color palette ([#5597](https://github.com/tailwindlabs/tailwindcss/pull/5597))
|
|
92
|
+
- Add `overflow-clip`, `overflow-x-clip` and `overflow-y-clip` utilities ([#5630](https://github.com/tailwindlabs/tailwindcss/pull/5630))
|
|
93
|
+
- Add `[open]` variant ([#5627](https://github.com/tailwindlabs/tailwindcss/pull/5627))
|
|
94
|
+
- Add `scroll-snap` utilities ([#5637](https://github.com/tailwindlabs/tailwindcss/pull/5637))
|
|
95
|
+
- Add `border-x` and `border-y` width and color utilities ([#5639](https://github.com/tailwindlabs/tailwindcss/pull/5639))
|
|
28
96
|
|
|
29
97
|
### Fixed
|
|
30
98
|
|
|
31
99
|
- Fix defining colors as functions when color opacity plugins are disabled ([#5470](https://github.com/tailwindlabs/tailwindcss/pull/5470))
|
|
100
|
+
- Fix using negated `content` globs ([#5625](https://github.com/tailwindlabs/tailwindcss/pull/5625))
|
|
101
|
+
- Fix using backslashes in `content` globs ([#5628](https://github.com/tailwindlabs/tailwindcss/pull/5628))
|
|
102
|
+
|
|
103
|
+
## [2.2.19] - 2021-10-29
|
|
104
|
+
|
|
105
|
+
### Fixed
|
|
106
|
+
|
|
107
|
+
- Ensure `corePlugins` order is consisent in AOT mode ([#5928](https://github.com/tailwindlabs/tailwindcss/pull/5928))
|
|
108
|
+
|
|
109
|
+
## [2.2.18] - 2021-10-29
|
|
110
|
+
|
|
111
|
+
### Fixed
|
|
112
|
+
|
|
113
|
+
- Bump versions for security vulnerabilities ([#5924](https://github.com/tailwindlabs/tailwindcss/pull/5924))
|
|
114
|
+
|
|
115
|
+
## [2.2.17] - 2021-10-13
|
|
116
|
+
|
|
117
|
+
### Fixed
|
|
118
|
+
|
|
119
|
+
- Configure chokidar's `awaitWriteFinish` setting to avoid occasional stale builds on Windows ([#5758](https://github.com/tailwindlabs/tailwindcss/pull/5758))
|
|
32
120
|
|
|
33
121
|
## [2.2.16] - 2021-09-26
|
|
34
122
|
|
|
@@ -1588,7 +1676,12 @@ No release notes
|
|
|
1588
1676
|
|
|
1589
1677
|
- Everything!
|
|
1590
1678
|
|
|
1591
|
-
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/
|
|
1679
|
+
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.0-alpha.2...HEAD
|
|
1680
|
+
[3.0.0-alpha.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.0-alpha.1...v3.0.0-alpha.2
|
|
1681
|
+
[3.0.0-alpha.1]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.19...v3.0.0-alpha.1
|
|
1682
|
+
[2.2.19]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.18...v2.2.19
|
|
1683
|
+
[2.2.18]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.17...v2.2.18
|
|
1684
|
+
[2.2.17]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.16...v2.2.17
|
|
1592
1685
|
[2.2.16]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.15...v2.2.16
|
|
1593
1686
|
[2.2.15]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15
|
|
1594
1687
|
[2.2.14]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.13...v2.2.14
|
package/lib/cli.js
CHANGED
|
@@ -15,13 +15,14 @@ var _fastGlob = _interopRequireDefault(require("fast-glob"));
|
|
|
15
15
|
var _getModuleDependencies = _interopRequireDefault(require("./lib/getModuleDependencies"));
|
|
16
16
|
var _log = _interopRequireDefault(require("./util/log"));
|
|
17
17
|
var _packageJson = _interopRequireDefault(require("../package.json"));
|
|
18
|
+
var _normalizePath = _interopRequireDefault(require("normalize-path"));
|
|
18
19
|
function _interopRequireDefault(obj) {
|
|
19
20
|
return obj && obj.__esModule ? obj : {
|
|
20
21
|
default: obj
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
let env = {
|
|
24
|
-
DEBUG: process.env.DEBUG !== undefined
|
|
25
|
+
DEBUG: process.env.DEBUG !== undefined && process.env.DEBUG !== '0'
|
|
25
26
|
};
|
|
26
27
|
// ---
|
|
27
28
|
function indentRecursive(node, indent = 0) {
|
|
@@ -109,7 +110,7 @@ function oneOf(...options) {
|
|
|
109
110
|
manualParsing: true
|
|
110
111
|
});
|
|
111
112
|
}
|
|
112
|
-
let
|
|
113
|
+
let commands1 = {
|
|
113
114
|
init: {
|
|
114
115
|
run: init,
|
|
115
116
|
args: {
|
|
@@ -186,30 +187,30 @@ if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.
|
|
|
186
187
|
'tailwindcss [--input input.css] [--output output.css] [--watch] [options...]',
|
|
187
188
|
'tailwindcss init [--full] [--postcss] [options...]',
|
|
188
189
|
],
|
|
189
|
-
commands: Object.keys(
|
|
190
|
+
commands: Object.keys(commands1).filter((command)=>command !== 'build'
|
|
190
191
|
).map((command)=>`${command} [options]`
|
|
191
192
|
),
|
|
192
193
|
options: {
|
|
193
|
-
...
|
|
194
|
+
...commands1.build.args,
|
|
194
195
|
...sharedFlags
|
|
195
196
|
}
|
|
196
197
|
});
|
|
197
198
|
process.exit(0);
|
|
198
199
|
}
|
|
199
|
-
let
|
|
200
|
+
let command1 = ((arg = '')=>arg.startsWith('-') ? undefined : arg
|
|
200
201
|
)(process.argv[2]) || 'build';
|
|
201
|
-
if (
|
|
202
|
-
if (_fs.default.existsSync(_path.default.resolve(
|
|
202
|
+
if (commands1[command1] === undefined) {
|
|
203
|
+
if (_fs.default.existsSync(_path.default.resolve(command1))) {
|
|
203
204
|
// TODO: Deprecate this in future versions
|
|
204
205
|
// Check if non-existing command, might be a file.
|
|
205
|
-
|
|
206
|
+
command1 = 'build';
|
|
206
207
|
} else {
|
|
207
208
|
help({
|
|
208
|
-
message: `Invalid command: ${
|
|
209
|
+
message: `Invalid command: ${command1}`,
|
|
209
210
|
usage: [
|
|
210
211
|
'tailwindcss <command> [options]'
|
|
211
212
|
],
|
|
212
|
-
commands: Object.keys(
|
|
213
|
+
commands: Object.keys(commands1).filter((command)=>command !== 'build'
|
|
213
214
|
).map((command)=>`${command} [options]`
|
|
214
215
|
),
|
|
215
216
|
options: sharedFlags
|
|
@@ -218,11 +219,11 @@ if (commands[command] === undefined) {
|
|
|
218
219
|
}
|
|
219
220
|
}
|
|
220
221
|
// Execute command
|
|
221
|
-
let { args:
|
|
222
|
-
let
|
|
222
|
+
let { args: flags1 , run } = commands1[command1];
|
|
223
|
+
let args1 = (()=>{
|
|
223
224
|
try {
|
|
224
225
|
let result = (0, _arg).default(Object.fromEntries(Object.entries({
|
|
225
|
-
...
|
|
226
|
+
...flags1,
|
|
226
227
|
...sharedFlags
|
|
227
228
|
}).filter(([_key, value])=>{
|
|
228
229
|
var ref;
|
|
@@ -239,11 +240,11 @@ let args = (()=>{
|
|
|
239
240
|
let flag = result['_'][i];
|
|
240
241
|
if (!flag.startsWith('-')) continue;
|
|
241
242
|
let flagName = flag;
|
|
242
|
-
let handler =
|
|
243
|
+
let handler = flags1[flag];
|
|
243
244
|
// Resolve flagName & handler
|
|
244
245
|
while(typeof handler === 'string'){
|
|
245
246
|
flagName = handler;
|
|
246
|
-
handler =
|
|
247
|
+
handler = flags1[handler];
|
|
247
248
|
}
|
|
248
249
|
if (!handler) continue;
|
|
249
250
|
let args = [];
|
|
@@ -263,8 +264,8 @@ let args = (()=>{
|
|
|
263
264
|
//
|
|
264
265
|
// E.g.: tailwindcss input.css -> _: ['build', 'input.css']
|
|
265
266
|
// E.g.: tailwindcss build input.css -> _: ['build', 'input.css']
|
|
266
|
-
if (result['_'][0] !==
|
|
267
|
-
result['_'].unshift(
|
|
267
|
+
if (result['_'][0] !== command1) {
|
|
268
|
+
result['_'].unshift(command1);
|
|
268
269
|
}
|
|
269
270
|
return result;
|
|
270
271
|
} catch (err) {
|
|
@@ -281,14 +282,14 @@ let args = (()=>{
|
|
|
281
282
|
throw err;
|
|
282
283
|
}
|
|
283
284
|
})();
|
|
284
|
-
if (
|
|
285
|
+
if (args1['--help']) {
|
|
285
286
|
help({
|
|
286
287
|
options: {
|
|
287
|
-
...
|
|
288
|
+
...flags1,
|
|
288
289
|
...sharedFlags
|
|
289
290
|
},
|
|
290
291
|
usage: [
|
|
291
|
-
`tailwindcss ${
|
|
292
|
+
`tailwindcss ${command1} [options]`
|
|
292
293
|
]
|
|
293
294
|
});
|
|
294
295
|
process.exit(0);
|
|
@@ -298,17 +299,17 @@ run();
|
|
|
298
299
|
function init() {
|
|
299
300
|
let messages = [];
|
|
300
301
|
var ref;
|
|
301
|
-
let tailwindConfigLocation = _path.default.resolve((ref =
|
|
302
|
+
let tailwindConfigLocation = _path.default.resolve((ref = args1['_'][1]) !== null && ref !== void 0 ? ref : './tailwind.config.js');
|
|
302
303
|
if (_fs.default.existsSync(tailwindConfigLocation)) {
|
|
303
304
|
messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`);
|
|
304
305
|
} else {
|
|
305
|
-
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');
|
|
306
307
|
// Change colors import
|
|
307
308
|
stubFile = stubFile.replace('../colors', 'tailwindcss/colors');
|
|
308
309
|
_fs.default.writeFileSync(tailwindConfigLocation, stubFile, 'utf8');
|
|
309
310
|
messages.push(`Created Tailwind CSS config file: ${_path.default.basename(tailwindConfigLocation)}`);
|
|
310
311
|
}
|
|
311
|
-
if (
|
|
312
|
+
if (args1['--postcss']) {
|
|
312
313
|
let postcssConfigLocation = _path.default.resolve('./postcss.config.js');
|
|
313
314
|
if (_fs.default.existsSync(postcssConfigLocation)) {
|
|
314
315
|
messages.push(`${_path.default.basename(postcssConfigLocation)} already exists.`);
|
|
@@ -326,27 +327,27 @@ function init() {
|
|
|
326
327
|
}
|
|
327
328
|
}
|
|
328
329
|
async function build() {
|
|
329
|
-
let input =
|
|
330
|
-
let output =
|
|
331
|
-
let shouldWatch =
|
|
332
|
-
let includePostCss =
|
|
330
|
+
let input = args1['--input'];
|
|
331
|
+
let output = args1['--output'];
|
|
332
|
+
let shouldWatch = args1['--watch'];
|
|
333
|
+
let includePostCss = args1['--postcss'];
|
|
333
334
|
// TODO: Deprecate this in future versions
|
|
334
|
-
if (!input &&
|
|
335
|
+
if (!input && args1['_'][1]) {
|
|
335
336
|
console.error('[deprecation] Running tailwindcss without -i, please provide an input file.');
|
|
336
|
-
input =
|
|
337
|
+
input = args1['--input'] = args1['_'][1];
|
|
337
338
|
}
|
|
338
339
|
if (input && !_fs.default.existsSync(input = _path.default.resolve(input))) {
|
|
339
|
-
console.error(`Specified input file ${
|
|
340
|
+
console.error(`Specified input file ${args1['--input']} does not exist.`);
|
|
340
341
|
process.exit(9);
|
|
341
342
|
}
|
|
342
|
-
if (
|
|
343
|
-
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.`);
|
|
344
345
|
process.exit(9);
|
|
345
346
|
}
|
|
346
|
-
let configPath =
|
|
347
|
+
let configPath = args1['--config'] ? args1['--config'] : ((defaultPath)=>_fs.default.existsSync(defaultPath) ? defaultPath : null
|
|
347
348
|
)(_path.default.resolve('./tailwind.config.js'));
|
|
348
349
|
async function loadPostCssPlugins() {
|
|
349
|
-
let customPostCssPath = typeof
|
|
350
|
+
let customPostCssPath = typeof args1['--postcss'] === 'string' ? args1['--postcss'] : undefined;
|
|
350
351
|
let { plugins: configPlugins } = customPostCssPath ? await (async ()=>{
|
|
351
352
|
let file = _path.default.resolve(customPostCssPath);
|
|
352
353
|
// Implementation, see: https://unpkg.com/browse/postcss-load-config@3.0.1/src/index.js
|
|
@@ -385,35 +386,31 @@ async function build() {
|
|
|
385
386
|
let config = configPath ? require(configPath) : {
|
|
386
387
|
};
|
|
387
388
|
let resolvedConfig = (0, _resolveConfig).default(config);
|
|
388
|
-
if (
|
|
389
|
-
_log.default.warn([
|
|
389
|
+
if (args1['--purge']) {
|
|
390
|
+
_log.default.warn('purge-flag-deprecated', [
|
|
390
391
|
'The `--purge` flag has been deprecated.',
|
|
391
|
-
'Please use `--content` instead.'
|
|
392
|
+
'Please use `--content` instead.',
|
|
392
393
|
]);
|
|
393
|
-
if (!
|
|
394
|
-
|
|
395
|
-
'--purge'
|
|
396
|
-
];
|
|
394
|
+
if (!args1['--content']) {
|
|
395
|
+
args1['--content'] = args1['--purge'];
|
|
397
396
|
}
|
|
398
397
|
}
|
|
399
|
-
if (
|
|
400
|
-
resolvedConfig.content =
|
|
398
|
+
if (args1['--content']) {
|
|
399
|
+
resolvedConfig.content.files = args1['--content'].split(/(?<!{[^}]+),/);
|
|
401
400
|
}
|
|
402
401
|
return resolvedConfig;
|
|
403
402
|
}
|
|
404
|
-
function extractContent(config) {
|
|
405
|
-
return config.content.content.concat(config.content.safelist);
|
|
406
|
-
}
|
|
407
403
|
function extractFileGlobs(config) {
|
|
408
|
-
return
|
|
404
|
+
return config.content.files.filter((file)=>{
|
|
409
405
|
// Strings in this case are files / globs. If it is something else,
|
|
410
406
|
// like an object it's probably a raw content object. But this object
|
|
411
407
|
// is not watchable, so let's remove it.
|
|
412
408
|
return typeof file === 'string';
|
|
413
|
-
})
|
|
409
|
+
}).map((glob)=>(0, _normalizePath).default(glob)
|
|
410
|
+
);
|
|
414
411
|
}
|
|
415
412
|
function extractRawContent(config) {
|
|
416
|
-
return
|
|
413
|
+
return config.content.files.filter((file)=>{
|
|
417
414
|
return typeof file === 'object' && file !== null;
|
|
418
415
|
});
|
|
419
416
|
}
|
|
@@ -425,7 +422,7 @@ async function build() {
|
|
|
425
422
|
for (let file of files){
|
|
426
423
|
changedContent.push({
|
|
427
424
|
content: _fs.default.readFileSync(_path.default.resolve(file), 'utf8'),
|
|
428
|
-
extension: _path.default.extname(file)
|
|
425
|
+
extension: _path.default.extname(file).slice(1)
|
|
429
426
|
});
|
|
430
427
|
}
|
|
431
428
|
// Resolve raw content in the tailwind config
|
|
@@ -460,9 +457,9 @@ async function build() {
|
|
|
460
457
|
let plugins = [
|
|
461
458
|
...beforePlugins,
|
|
462
459
|
tailwindPlugin,
|
|
463
|
-
!
|
|
460
|
+
!args1['--minify'] && formatNodes,
|
|
464
461
|
...afterPlugins,
|
|
465
|
-
!
|
|
462
|
+
!args1['--no-autoprefixer'] && (()=>{
|
|
466
463
|
// Try to load a local `autoprefixer` version first
|
|
467
464
|
try {
|
|
468
465
|
return require('autoprefixer');
|
|
@@ -470,7 +467,7 @@ async function build() {
|
|
|
470
467
|
}
|
|
471
468
|
return (0, _indexJs).lazyAutoprefixer();
|
|
472
469
|
})(),
|
|
473
|
-
|
|
470
|
+
args1['--minify'] && (()=>{
|
|
474
471
|
let options = {
|
|
475
472
|
preset: [
|
|
476
473
|
'default',
|
|
@@ -513,8 +510,8 @@ async function build() {
|
|
|
513
510
|
console.error('Done in', (end - start) / BigInt(1000000) + 'ms.');
|
|
514
511
|
});
|
|
515
512
|
}
|
|
516
|
-
let
|
|
517
|
-
return processCSS(
|
|
513
|
+
let css1 = input ? _fs.default.readFileSync(_path.default.resolve(input), 'utf8') : '@tailwind base; @tailwind components; @tailwind utilities';
|
|
514
|
+
return processCSS(css1);
|
|
518
515
|
}
|
|
519
516
|
let context = null;
|
|
520
517
|
async function startWatcher() {
|
|
@@ -524,8 +521,8 @@ async function build() {
|
|
|
524
521
|
let watcher = null;
|
|
525
522
|
function refreshConfig() {
|
|
526
523
|
env.DEBUG && console.time('Module dependencies');
|
|
527
|
-
for (let
|
|
528
|
-
delete require.cache[require.resolve(
|
|
524
|
+
for (let file1 of configDependencies){
|
|
525
|
+
delete require.cache[require.resolve(file1)];
|
|
529
526
|
}
|
|
530
527
|
if (configPath) {
|
|
531
528
|
configDependencies = (0, _getModuleDependencies).default(configPath).map(({ file })=>file
|
|
@@ -544,9 +541,9 @@ async function build() {
|
|
|
544
541
|
let plugins = [
|
|
545
542
|
...beforePlugins,
|
|
546
543
|
'__TAILWIND_PLUGIN_POSITION__',
|
|
547
|
-
!
|
|
544
|
+
!args1['--minify'] && formatNodes,
|
|
548
545
|
...afterPlugins,
|
|
549
|
-
!
|
|
546
|
+
!args1['--no-autoprefixer'] && (()=>{
|
|
550
547
|
// Try to load a local `autoprefixer` version first
|
|
551
548
|
try {
|
|
552
549
|
return require('autoprefixer');
|
|
@@ -554,7 +551,7 @@ async function build() {
|
|
|
554
551
|
}
|
|
555
552
|
return (0, _indexJs).lazyAutoprefixer();
|
|
556
553
|
})(),
|
|
557
|
-
|
|
554
|
+
args1['--minify'] && (()=>{
|
|
558
555
|
let options = {
|
|
559
556
|
preset: [
|
|
560
557
|
'default',
|
|
@@ -639,44 +636,48 @@ async function build() {
|
|
|
639
636
|
}
|
|
640
637
|
});
|
|
641
638
|
}
|
|
642
|
-
let
|
|
643
|
-
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);
|
|
644
641
|
env.DEBUG && console.timeEnd('Finished in');
|
|
645
642
|
return result1;
|
|
646
643
|
}
|
|
647
|
-
let
|
|
644
|
+
let config1 = refreshConfig(configPath);
|
|
648
645
|
if (input) {
|
|
649
646
|
contextDependencies.add(_path.default.resolve(input));
|
|
650
647
|
}
|
|
651
648
|
watcher = _chokidar.default.watch([
|
|
652
649
|
...contextDependencies,
|
|
653
|
-
...extractFileGlobs(
|
|
650
|
+
...extractFileGlobs(config1)
|
|
654
651
|
], {
|
|
655
|
-
ignoreInitial: true
|
|
652
|
+
ignoreInitial: true,
|
|
653
|
+
awaitWriteFinish: process.platform === 'win32' ? {
|
|
654
|
+
stabilityThreshold: 50,
|
|
655
|
+
pollInterval: 10
|
|
656
|
+
} : false
|
|
656
657
|
});
|
|
657
658
|
let chain = Promise.resolve();
|
|
658
659
|
watcher.on('change', async (file)=>{
|
|
659
660
|
if (contextDependencies.has(file)) {
|
|
660
661
|
env.DEBUG && console.time('Resolve config');
|
|
661
662
|
context = null;
|
|
662
|
-
|
|
663
|
+
config1 = refreshConfig(configPath);
|
|
663
664
|
env.DEBUG && console.timeEnd('Resolve config');
|
|
664
665
|
env.DEBUG && console.time('Watch new files');
|
|
665
|
-
let globs = extractFileGlobs(
|
|
666
|
+
let globs = extractFileGlobs(config1);
|
|
666
667
|
watcher.add(configDependencies);
|
|
667
668
|
watcher.add(globs);
|
|
668
669
|
env.DEBUG && console.timeEnd('Watch new files');
|
|
669
670
|
chain = chain.then(async ()=>{
|
|
670
|
-
changedContent.push(...getChangedContent(
|
|
671
|
-
await rebuild(
|
|
671
|
+
changedContent.push(...getChangedContent(config1));
|
|
672
|
+
await rebuild(config1);
|
|
672
673
|
});
|
|
673
674
|
} else {
|
|
674
675
|
chain = chain.then(async ()=>{
|
|
675
676
|
changedContent.push({
|
|
676
677
|
content: _fs.default.readFileSync(_path.default.resolve(file), 'utf8'),
|
|
677
|
-
extension: _path.default.extname(file)
|
|
678
|
+
extension: _path.default.extname(file).slice(1)
|
|
678
679
|
});
|
|
679
|
-
await rebuild(
|
|
680
|
+
await rebuild(config1);
|
|
680
681
|
});
|
|
681
682
|
}
|
|
682
683
|
});
|
|
@@ -684,14 +685,14 @@ async function build() {
|
|
|
684
685
|
chain = chain.then(async ()=>{
|
|
685
686
|
changedContent.push({
|
|
686
687
|
content: _fs.default.readFileSync(_path.default.resolve(file), 'utf8'),
|
|
687
|
-
extension: _path.default.extname(file)
|
|
688
|
+
extension: _path.default.extname(file).slice(1)
|
|
688
689
|
});
|
|
689
|
-
await rebuild(
|
|
690
|
+
await rebuild(config1);
|
|
690
691
|
});
|
|
691
692
|
});
|
|
692
693
|
chain = chain.then(()=>{
|
|
693
|
-
changedContent.push(...getChangedContent(
|
|
694
|
-
return rebuild(
|
|
694
|
+
changedContent.push(...getChangedContent(config1));
|
|
695
|
+
return rebuild(config1);
|
|
695
696
|
});
|
|
696
697
|
}
|
|
697
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",
|
|
@@ -48,6 +49,11 @@ var _default = [
|
|
|
48
49
|
"touchAction",
|
|
49
50
|
"userSelect",
|
|
50
51
|
"resize",
|
|
52
|
+
"scrollSnapType",
|
|
53
|
+
"scrollSnapAlign",
|
|
54
|
+
"scrollSnapStop",
|
|
55
|
+
"scrollMargin",
|
|
56
|
+
"scrollPadding",
|
|
51
57
|
"listStylePosition",
|
|
52
58
|
"listStyleType",
|
|
53
59
|
"appearance",
|
|
@@ -119,6 +125,10 @@ var _default = [
|
|
|
119
125
|
"textColor",
|
|
120
126
|
"textOpacity",
|
|
121
127
|
"textDecoration",
|
|
128
|
+
"textDecorationColor",
|
|
129
|
+
"textDecorationStyle",
|
|
130
|
+
"textDecorationThickness",
|
|
131
|
+
"textUnderlineOffset",
|
|
122
132
|
"fontSmoothing",
|
|
123
133
|
"placeholderColor",
|
|
124
134
|
"placeholderOpacity",
|
|
@@ -128,7 +138,11 @@ var _default = [
|
|
|
128
138
|
"backgroundBlendMode",
|
|
129
139
|
"mixBlendMode",
|
|
130
140
|
"boxShadow",
|
|
131
|
-
"
|
|
141
|
+
"boxShadowColor",
|
|
142
|
+
"outlineStyle",
|
|
143
|
+
"outlineWidth",
|
|
144
|
+
"outlineOffset",
|
|
145
|
+
"outlineColor",
|
|
132
146
|
"ringWidth",
|
|
133
147
|
"ringColor",
|
|
134
148
|
"ringOpacity",
|