tailwindcss 0.0.0-insiders.df011dc → 0.0.0-insiders.e2d5f21
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 +106 -1
- package/README.md +1 -1
- package/colors.js +1 -304
- package/defaultConfig.js +1 -4
- package/defaultTheme.js +1 -4
- package/lib/cli-peer-dependencies.js +4 -9
- package/lib/cli.js +646 -705
- package/lib/constants.js +15 -15
- package/lib/corePluginList.js +174 -4
- package/lib/corePlugins.js +3637 -2934
- package/lib/css/preflight.css +14 -1
- package/lib/featureFlags.js +44 -44
- package/lib/index.js +25 -24
- package/lib/lib/collapseAdjacentRules.js +33 -35
- package/lib/lib/collapseDuplicateDeclarations.js +29 -0
- package/lib/lib/detectNesting.js +34 -0
- package/lib/lib/evaluateTailwindFunctions.js +134 -155
- package/lib/lib/expandApplyAtRules.js +183 -200
- package/lib/lib/expandTailwindAtRules.js +219 -232
- package/lib/lib/generateRules.js +478 -311
- package/lib/lib/getModuleDependencies.js +36 -41
- package/lib/lib/normalizeTailwindDirectives.js +66 -58
- package/lib/lib/resolveDefaultsAtRules.js +110 -90
- package/lib/lib/setupContextUtils.js +740 -580
- package/lib/lib/setupTrackingContext.js +142 -162
- package/lib/lib/setupWatchingContext.js +235 -278
- package/lib/lib/sharedState.js +7 -17
- package/lib/lib/substituteScreenAtRules.js +22 -26
- package/lib/processTailwindFeatures.js +38 -44
- package/lib/public/colors.js +329 -0
- package/lib/public/create-plugin.js +13 -0
- package/lib/public/default-config.js +14 -0
- package/lib/public/default-theme.js +14 -0
- package/lib/public/resolve-config.js +19 -0
- package/lib/util/bigSign.js +3 -5
- package/lib/util/buildMediaQuery.js +15 -31
- package/lib/util/cloneDeep.js +14 -13
- package/lib/util/cloneNodes.js +9 -13
- package/lib/util/color.js +69 -59
- package/lib/util/configurePlugins.js +13 -14
- package/lib/util/createPlugin.js +21 -24
- package/lib/util/createUtilityPlugin.js +47 -45
- package/lib/util/dataTypes.js +231 -0
- package/lib/util/defaults.js +10 -14
- package/lib/util/escapeClassName.js +12 -14
- package/lib/util/escapeCommas.js +3 -5
- package/lib/util/flattenColorPalette.js +14 -10
- package/lib/util/formatVariantSelector.js +186 -0
- package/lib/util/getAllConfigs.js +23 -16
- package/lib/util/hashConfig.js +10 -10
- package/lib/util/isKeyframeRule.js +3 -5
- package/lib/util/isPlainObject.js +7 -10
- package/lib/util/isValidArbitraryValue.js +64 -0
- package/lib/util/log.js +39 -30
- package/lib/util/nameClass.js +23 -23
- package/lib/util/negateValue.js +14 -15
- package/lib/util/normalizeConfig.js +208 -0
- package/lib/util/normalizeScreens.js +58 -0
- package/lib/util/parseAnimationValue.js +82 -53
- package/lib/util/parseBoxShadowValue.js +77 -0
- package/lib/util/parseDependency.js +49 -60
- package/lib/util/parseObjectStyles.js +23 -20
- package/lib/util/pluginUtils.js +153 -285
- package/lib/util/prefixSelector.js +14 -16
- package/lib/util/resolveConfig.js +194 -249
- package/lib/util/resolveConfigPath.js +38 -45
- package/lib/util/responsive.js +12 -11
- package/lib/util/tap.js +4 -6
- package/lib/util/toColorValue.js +4 -5
- package/lib/util/toPath.js +4 -6
- package/lib/util/transformThemeValue.js +57 -26
- package/lib/util/withAlphaVariable.js +56 -54
- package/package.json +27 -37
- package/peers/index.js +73099 -84294
- package/plugin.js +1 -3
- package/resolveConfig.js +1 -7
- package/scripts/create-plugin-list.js +2 -2
- package/src/cli.js +27 -18
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +2124 -1968
- 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 +39 -0
- package/src/lib/evaluateTailwindFunctions.js +5 -2
- package/src/lib/expandTailwindAtRules.js +24 -32
- package/src/lib/generateRules.js +230 -20
- package/src/lib/normalizeTailwindDirectives.js +3 -2
- package/src/lib/resolveDefaultsAtRules.js +46 -30
- package/src/lib/setupContextUtils.js +275 -113
- package/src/lib/setupTrackingContext.js +9 -8
- package/src/lib/setupWatchingContext.js +12 -7
- package/src/lib/sharedState.js +1 -4
- package/src/lib/substituteScreenAtRules.js +6 -3
- package/src/processTailwindFeatures.js +8 -1
- package/src/public/colors.js +300 -0
- package/src/public/create-plugin.js +2 -0
- package/src/public/default-config.js +4 -0
- package/src/public/default-theme.js +4 -0
- package/src/public/resolve-config.js +7 -0
- package/src/util/buildMediaQuery.js +14 -18
- package/src/util/createUtilityPlugin.js +2 -11
- package/src/util/dataTypes.js +246 -0
- 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 +10 -6
- package/src/util/negateValue.js +4 -2
- package/src/util/normalizeConfig.js +249 -0
- package/src/util/normalizeScreens.js +42 -0
- package/src/util/parseAnimationValue.js +7 -1
- package/src/util/parseBoxShadowValue.js +71 -0
- package/src/util/parseDependency.js +4 -0
- package/src/util/pluginUtils.js +101 -204
- package/src/util/prefixSelector.js +1 -4
- package/src/util/resolveConfig.js +12 -65
- package/src/util/transformThemeValue.js +22 -7
- package/src/util/withAlphaVariable.js +13 -8
- package/stubs/defaultConfig.stub.js +163 -97
- package/stubs/simpleConfig.stub.js +0 -1
package/lib/css/preflight.css
CHANGED
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
border-color: currentColor; /* 2 */
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
::before,
|
|
16
|
+
::after {
|
|
17
|
+
--tw-content: '';
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
/*
|
|
16
21
|
1. Use a consistent sensible line-height in all browsers.
|
|
17
22
|
2. Prevent adjustments of font size after orientation changes in iOS.
|
|
@@ -283,7 +288,8 @@ legend {
|
|
|
283
288
|
}
|
|
284
289
|
|
|
285
290
|
ol,
|
|
286
|
-
ul
|
|
291
|
+
ul,
|
|
292
|
+
menu {
|
|
287
293
|
list-style: none;
|
|
288
294
|
margin: 0;
|
|
289
295
|
padding: 0;
|
|
@@ -317,6 +323,13 @@ button,
|
|
|
317
323
|
cursor: pointer;
|
|
318
324
|
}
|
|
319
325
|
|
|
326
|
+
/*
|
|
327
|
+
Make sure disabled buttons don't get the pointer cursor.
|
|
328
|
+
*/
|
|
329
|
+
:disabled {
|
|
330
|
+
cursor: default;
|
|
331
|
+
}
|
|
332
|
+
|
|
320
333
|
/*
|
|
321
334
|
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
|
|
322
335
|
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
|
package/lib/featureFlags.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
5
|
exports.flagEnabled = flagEnabled;
|
|
7
6
|
exports.issueFlagNotices = issueFlagNotices;
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
11
|
-
|
|
12
9
|
var _log = _interopRequireDefault(require("./util/log"));
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : {
|
|
12
|
+
default: obj
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
let defaults = {
|
|
16
|
+
optimizeUniversalDefaults: true
|
|
17
|
+
};
|
|
18
|
+
let featureFlags = {
|
|
19
|
+
future: [],
|
|
20
|
+
experimental: [
|
|
21
|
+
'optimizeUniversalDefaults'
|
|
22
|
+
]
|
|
19
23
|
};
|
|
20
|
-
|
|
21
24
|
function flagEnabled(config, flag) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return false;
|
|
25
|
+
if (featureFlags.future.includes(flag)) {
|
|
26
|
+
var ref;
|
|
27
|
+
var ref1, ref2;
|
|
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
|
+
}
|
|
30
|
+
if (featureFlags.experimental.includes(flag)) {
|
|
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
|
+
}
|
|
35
|
+
return false;
|
|
35
36
|
}
|
|
36
|
-
|
|
37
37
|
function experimentalFlagsEnabled(config) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
if (config.experimental === 'all') {
|
|
39
|
+
return featureFlags.experimental;
|
|
40
|
+
}
|
|
41
|
+
var ref;
|
|
42
|
+
return Object.keys((ref = config === null || config === void 0 ? void 0 : config.experimental) !== null && ref !== void 0 ? ref : {
|
|
43
|
+
}).filter((flag)=>featureFlags.experimental.includes(flag) && config.experimental[flag]
|
|
44
|
+
);
|
|
45
45
|
}
|
|
46
|
-
|
|
47
46
|
function issueFlagNotices(config) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
if (process.env.JEST_WORKER_ID !== undefined) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (experimentalFlagsEnabled(config).length > 0) {
|
|
51
|
+
let changes = experimentalFlagsEnabled(config).map((s)=>_chalk.default.yellow(s)
|
|
52
|
+
).join(', ');
|
|
53
|
+
_log.default.warn('experimental-flags-enabled', [
|
|
54
|
+
`You have enabled experimental features: ${changes}`,
|
|
55
|
+
'Experimental features in Tailwind CSS are not covered by semver, may introduce breaking changes, and can change at any time.',
|
|
56
|
+
]);
|
|
57
|
+
}
|
|
57
58
|
}
|
|
58
|
-
|
|
59
59
|
var _default = featureFlags;
|
|
60
|
-
exports.default = _default;
|
|
60
|
+
exports.default = _default;
|
package/lib/index.js
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
var _setupTrackingContext = _interopRequireDefault(require("./lib/setupTrackingContext"));
|
|
4
|
-
|
|
5
3
|
var _setupWatchingContext = _interopRequireDefault(require("./lib/setupWatchingContext"));
|
|
6
|
-
|
|
7
4
|
var _processTailwindFeatures = _interopRequireDefault(require("./processTailwindFeatures"));
|
|
8
|
-
|
|
9
5
|
var _sharedState = require("./lib/sharedState");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
function _interopRequireDefault(obj) {
|
|
7
|
+
return obj && obj.__esModule ? obj : {
|
|
8
|
+
default: obj
|
|
9
|
+
};
|
|
10
|
+
}
|
|
13
11
|
module.exports = function tailwindcss(configOrPath) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
12
|
+
return {
|
|
13
|
+
postcssPlugin: 'tailwindcss',
|
|
14
|
+
plugins: [
|
|
15
|
+
_sharedState.env.DEBUG && function(root) {
|
|
16
|
+
console.log('\n');
|
|
17
|
+
console.time('JIT TOTAL');
|
|
18
|
+
return root;
|
|
19
|
+
},
|
|
20
|
+
function(root, result) {
|
|
21
|
+
let setupContext = _sharedState.env.TAILWIND_MODE === 'watch' ? (0, _setupWatchingContext).default(configOrPath) : (0, _setupTrackingContext).default(configOrPath);
|
|
22
|
+
(0, _processTailwindFeatures).default(setupContext)(root, result);
|
|
23
|
+
},
|
|
24
|
+
_sharedState.env.DEBUG && function(root) {
|
|
25
|
+
console.timeEnd('JIT TOTAL');
|
|
26
|
+
console.log('\n');
|
|
27
|
+
return root;
|
|
28
|
+
},
|
|
29
|
+
].filter(Boolean)
|
|
30
|
+
};
|
|
29
31
|
};
|
|
30
|
-
|
|
31
|
-
module.exports.postcss = true;
|
|
32
|
+
module.exports.postcss = true;
|
|
@@ -1,43 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
5
|
exports.default = collapseAdjacentRules;
|
|
7
6
|
let comparisonMap = {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
atrule: [
|
|
8
|
+
'name',
|
|
9
|
+
'params'
|
|
10
|
+
],
|
|
11
|
+
rule: [
|
|
12
|
+
'selector'
|
|
13
|
+
]
|
|
10
14
|
};
|
|
11
15
|
let types = new Set(Object.keys(comparisonMap));
|
|
12
|
-
|
|
13
16
|
function collapseAdjacentRules() {
|
|
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
|
-
currentRule = node;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
}
|
|
17
|
+
return (root)=>{
|
|
18
|
+
let currentRule = null;
|
|
19
|
+
root.each((node)=>{
|
|
20
|
+
if (!types.has(node.type)) {
|
|
21
|
+
currentRule = null;
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (currentRule === null) {
|
|
25
|
+
currentRule = node;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
let properties = comparisonMap[node.type];
|
|
29
|
+
var _property, _property1;
|
|
30
|
+
if (node.type === 'atrule' && node.name === 'font-face') {
|
|
31
|
+
currentRule = node;
|
|
32
|
+
} else if (properties.every((property)=>((_property = node[property]) !== null && _property !== void 0 ? _property : '').replace(/\s+/g, ' ') === ((_property1 = currentRule[property]) !== null && _property1 !== void 0 ? _property1 : '').replace(/\s+/g, ' ')
|
|
33
|
+
)) {
|
|
34
|
+
currentRule.append(node.nodes);
|
|
35
|
+
node.remove();
|
|
36
|
+
} else {
|
|
37
|
+
currentRule = node;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.default = collapseDuplicateDeclarations;
|
|
6
|
+
function collapseDuplicateDeclarations() {
|
|
7
|
+
return (root)=>{
|
|
8
|
+
root.walkRules((node)=>{
|
|
9
|
+
let seen = new Map();
|
|
10
|
+
let droppable = new Set([]);
|
|
11
|
+
node.walkDecls((decl)=>{
|
|
12
|
+
// This could happen if we have nested selectors. In that case the
|
|
13
|
+
// parent will loop over all its declarations but also the declarations
|
|
14
|
+
// of nested rules. With this we ensure that we are shallowly checking
|
|
15
|
+
// declarations.
|
|
16
|
+
if (decl.parent !== node) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (seen.has(decl.prop)) {
|
|
20
|
+
droppable.add(seen.get(decl.prop));
|
|
21
|
+
}
|
|
22
|
+
seen.set(decl.prop, decl);
|
|
23
|
+
});
|
|
24
|
+
for (let decl1 of droppable){
|
|
25
|
+
decl1.remove();
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.default = _default;
|
|
6
|
+
function _default(_context) {
|
|
7
|
+
return (root, result)=>{
|
|
8
|
+
let found = false;
|
|
9
|
+
root.walkAtRules('tailwind', (node)=>{
|
|
10
|
+
if (found) return false;
|
|
11
|
+
if (node.parent && node.parent.type !== 'root') {
|
|
12
|
+
found = true;
|
|
13
|
+
node.warn(result, [
|
|
14
|
+
'Nested @tailwind rules were detected, but are not supported.',
|
|
15
|
+
"Consider using a prefix to scope Tailwind's classes: https://tailwindcss.com/docs/configuration#prefix",
|
|
16
|
+
'Alternatively, use the important selector strategy: https://tailwindcss.com/docs/configuration#selector-strategy',
|
|
17
|
+
].join('\n'));
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
root.walkRules((rule)=>{
|
|
22
|
+
if (found) return false;
|
|
23
|
+
rule.walkRules((nestedRule)=>{
|
|
24
|
+
found = true;
|
|
25
|
+
nestedRule.warn(result, [
|
|
26
|
+
'Nested CSS was detected, but CSS nesting has not been configured correctly.',
|
|
27
|
+
'Please enable a CSS nesting plugin *before* Tailwind in your configuration.',
|
|
28
|
+
'See how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting',
|
|
29
|
+
].join('\n'));
|
|
30
|
+
return false;
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
}
|