tailwindcss 0.0.0-insiders.ee3f3fd → 0.0.0-insiders.eebf529
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 +62 -3
- package/colors.js +2 -1
- package/defaultConfig.js +2 -1
- package/defaultTheme.js +2 -1
- package/lib/cli.js +33 -33
- package/lib/constants.js +1 -1
- package/lib/corePluginList.js +8 -1
- package/lib/corePlugins.js +232 -77
- package/lib/css/preflight.css +2 -1
- 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 +9 -5
- package/lib/lib/expandApplyAtRules.js +9 -9
- package/lib/lib/expandTailwindAtRules.js +2 -0
- package/lib/lib/generateRules.js +46 -10
- package/lib/lib/resolveDefaultsAtRules.js +2 -2
- package/lib/lib/setupContextUtils.js +17 -73
- package/lib/lib/sharedState.js +2 -2
- package/lib/lib/substituteScreenAtRules.js +7 -4
- package/lib/util/buildMediaQuery.js +13 -24
- package/lib/util/createUtilityPlugin.js +2 -2
- package/lib/util/dataTypes.js +25 -3
- package/lib/util/formatVariantSelector.js +93 -9
- package/lib/util/isValidArbitraryValue.js +64 -0
- package/lib/util/nameClass.js +1 -0
- package/lib/util/normalizeConfig.js +7 -7
- package/lib/util/normalizeScreens.js +61 -0
- package/lib/util/parseBoxShadowValue.js +77 -0
- package/lib/util/pluginUtils.js +12 -11
- package/lib/util/resolveConfig.js +12 -12
- package/lib/util/transformThemeValue.js +23 -13
- package/package.json +12 -12
- package/peers/index.js +4456 -5450
- package/plugin.js +2 -1
- package/resolveConfig.js +2 -1
- package/src/cli.js +1 -1
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +172 -67
- package/src/css/preflight.css +2 -1
- package/src/lib/detectNesting.js +22 -3
- package/src/lib/evaluateTailwindFunctions.js +5 -2
- package/src/lib/expandApplyAtRules.js +2 -2
- package/src/lib/expandTailwindAtRules.js +2 -0
- package/src/lib/generateRules.js +34 -0
- package/src/lib/setupContextUtils.js +8 -59
- package/src/lib/sharedState.js +1 -1
- package/src/lib/substituteScreenAtRules.js +6 -3
- package/src/util/buildMediaQuery.js +14 -18
- package/src/util/dataTypes.js +24 -6
- package/src/util/formatVariantSelector.js +92 -1
- package/src/util/isValidArbitraryValue.js +61 -0
- package/src/util/nameClass.js +1 -1
- package/src/util/normalizeScreens.js +45 -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 +40 -14
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,8 @@ 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 _normalizeScreens = require("./util/normalizeScreens");
|
|
20
|
+
var _parseBoxShadowValue = require("./util/parseBoxShadowValue");
|
|
19
21
|
function _interopRequireDefault(obj) {
|
|
20
22
|
return obj && obj.__esModule ? obj : {
|
|
21
23
|
default: obj
|
|
@@ -57,6 +59,7 @@ let variantPlugins = {
|
|
|
57
59
|
'&::selection'
|
|
58
60
|
]);
|
|
59
61
|
addVariant('file', '&::file-selector-button');
|
|
62
|
+
addVariant('placeholder', '&::placeholder');
|
|
60
63
|
addVariant('before', ({ container })=>{
|
|
61
64
|
container.walkRules((rule)=>{
|
|
62
65
|
let foundContent = false;
|
|
@@ -192,12 +195,18 @@ let variantPlugins = {
|
|
|
192
195
|
addVariant('dark', '@media (prefers-color-scheme: dark)');
|
|
193
196
|
}
|
|
194
197
|
},
|
|
198
|
+
printVariant: ({ addVariant })=>{
|
|
199
|
+
addVariant('print', '@media print');
|
|
200
|
+
},
|
|
195
201
|
screenVariants: ({ theme , addVariant })=>{
|
|
196
|
-
for(let screen
|
|
197
|
-
let
|
|
198
|
-
|
|
199
|
-
addVariant(screen, `@media ${query}`);
|
|
202
|
+
for (let screen of (0, _normalizeScreens).normalizeScreens(theme('screens'))){
|
|
203
|
+
let query = (0, _buildMediaQuery).default(screen);
|
|
204
|
+
addVariant(screen.name, `@media ${query}`);
|
|
200
205
|
}
|
|
206
|
+
},
|
|
207
|
+
orientationVariants: ({ addVariant })=>{
|
|
208
|
+
addVariant('portrait', '@media (orientation: portrait)');
|
|
209
|
+
addVariant('landscape', '@media (orientation: landscape)');
|
|
201
210
|
}
|
|
202
211
|
};
|
|
203
212
|
exports.variantPlugins = variantPlugins;
|
|
@@ -212,27 +221,11 @@ let corePlugins = {
|
|
|
212
221
|
]);
|
|
213
222
|
},
|
|
214
223
|
container: (()=>{
|
|
215
|
-
function extractMinWidths(breakpoints) {
|
|
216
|
-
return
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
min: breakpoints
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
if (!Array.isArray(breakpoints)) {
|
|
224
|
-
breakpoints = [
|
|
225
|
-
breakpoints
|
|
226
|
-
];
|
|
227
|
-
}
|
|
228
|
-
return breakpoints.filter((breakpoint)=>{
|
|
229
|
-
var ref;
|
|
230
|
-
return (breakpoint === null || breakpoint === void 0 ? void 0 : (ref = breakpoint.hasOwnProperty) === null || ref === void 0 ? void 0 : ref.call(breakpoint, 'min')) || (breakpoint === null || breakpoint === void 0 ? void 0 : breakpoint.hasOwnProperty('min-width'));
|
|
231
|
-
}).map((breakpoint)=>{
|
|
232
|
-
var ref;
|
|
233
|
-
return (ref = breakpoint['min-width']) !== null && ref !== void 0 ? ref : breakpoint.min;
|
|
234
|
-
});
|
|
235
|
-
});
|
|
224
|
+
function extractMinWidths(breakpoints = []) {
|
|
225
|
+
return breakpoints.flatMap((breakpoint1)=>breakpoint1.values.map((breakpoint)=>breakpoint.min
|
|
226
|
+
)
|
|
227
|
+
).filter((v)=>v !== undefined
|
|
228
|
+
);
|
|
236
229
|
}
|
|
237
230
|
function mapMinWidthsToPadding(minWidths, screens, paddings) {
|
|
238
231
|
if (typeof paddings === 'undefined') {
|
|
@@ -256,25 +249,25 @@ let corePlugins = {
|
|
|
256
249
|
});
|
|
257
250
|
}
|
|
258
251
|
for (let minWidth of minWidths){
|
|
259
|
-
for (let
|
|
260
|
-
let
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
252
|
+
for (let screen of screens){
|
|
253
|
+
for (let { min } of screen.values){
|
|
254
|
+
if (min === minWidth) {
|
|
255
|
+
mapping.push({
|
|
256
|
+
minWidth,
|
|
257
|
+
padding: paddings[screen.name]
|
|
258
|
+
});
|
|
259
|
+
}
|
|
267
260
|
}
|
|
268
261
|
}
|
|
269
262
|
}
|
|
270
263
|
return mapping;
|
|
271
264
|
}
|
|
272
265
|
return function({ addComponents , theme }) {
|
|
273
|
-
let screens = theme('container.screens', theme('screens'));
|
|
266
|
+
let screens = (0, _normalizeScreens).normalizeScreens(theme('container.screens', theme('screens')));
|
|
274
267
|
let minWidths = extractMinWidths(screens);
|
|
275
268
|
let paddings = mapMinWidthsToPadding(minWidths, screens, theme('container.padding'));
|
|
276
269
|
let generatePaddingFor = (minWidth)=>{
|
|
277
|
-
let paddingConfig = paddings.find((padding)
|
|
270
|
+
let paddingConfig = paddings.find((padding)=>padding.minWidth === minWidth
|
|
278
271
|
);
|
|
279
272
|
if (!paddingConfig) {
|
|
280
273
|
return {
|
|
@@ -918,7 +911,9 @@ let corePlugins = {
|
|
|
918
911
|
],
|
|
919
912
|
],
|
|
920
913
|
],
|
|
921
|
-
]
|
|
914
|
+
], {
|
|
915
|
+
supportsNegativeValues: true
|
|
916
|
+
}),
|
|
922
917
|
transform: ({ addBase , addUtilities })=>{
|
|
923
918
|
addBase({
|
|
924
919
|
'@defaults transform': {
|
|
@@ -986,8 +981,8 @@ let corePlugins = {
|
|
|
986
981
|
];
|
|
987
982
|
}));
|
|
988
983
|
matchUtilities({
|
|
989
|
-
animate: (
|
|
990
|
-
let animations = (0, _parseAnimationValue).default(
|
|
984
|
+
animate: (value1)=>{
|
|
985
|
+
let animations = (0, _parseAnimationValue).default(value1);
|
|
991
986
|
return [
|
|
992
987
|
...animations.flatMap((animation)=>keyframes[animation.name]
|
|
993
988
|
),
|
|
@@ -1006,7 +1001,15 @@ let corePlugins = {
|
|
|
1006
1001
|
});
|
|
1007
1002
|
},
|
|
1008
1003
|
cursor: (0, _createUtilityPlugin).default('cursor'),
|
|
1009
|
-
touchAction: ({ addUtilities })=>{
|
|
1004
|
+
touchAction: ({ addBase , addUtilities })=>{
|
|
1005
|
+
addBase({
|
|
1006
|
+
'@defaults touch-action': {
|
|
1007
|
+
'--tw-pan-x': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1008
|
+
'--tw-pan-y': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1009
|
+
'--tw-pinch-zoom': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1010
|
+
'--tw-touch-action': 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)'
|
|
1011
|
+
}
|
|
1012
|
+
});
|
|
1010
1013
|
addUtilities({
|
|
1011
1014
|
'.touch-auto': {
|
|
1012
1015
|
'touch-action': 'auto'
|
|
@@ -1015,25 +1018,46 @@ let corePlugins = {
|
|
|
1015
1018
|
'touch-action': 'none'
|
|
1016
1019
|
},
|
|
1017
1020
|
'.touch-pan-x': {
|
|
1018
|
-
'touch-action':
|
|
1021
|
+
'@defaults touch-action': {
|
|
1022
|
+
},
|
|
1023
|
+
'--tw-pan-x': 'pan-x',
|
|
1024
|
+
'touch-action': 'var(--tw-touch-action)'
|
|
1019
1025
|
},
|
|
1020
1026
|
'.touch-pan-left': {
|
|
1021
|
-
'touch-action':
|
|
1027
|
+
'@defaults touch-action': {
|
|
1028
|
+
},
|
|
1029
|
+
'--tw-pan-x': 'pan-left',
|
|
1030
|
+
'touch-action': 'var(--tw-touch-action)'
|
|
1022
1031
|
},
|
|
1023
1032
|
'.touch-pan-right': {
|
|
1024
|
-
'touch-action':
|
|
1033
|
+
'@defaults touch-action': {
|
|
1034
|
+
},
|
|
1035
|
+
'--tw-pan-x': 'pan-right',
|
|
1036
|
+
'touch-action': 'var(--tw-touch-action)'
|
|
1025
1037
|
},
|
|
1026
1038
|
'.touch-pan-y': {
|
|
1027
|
-
'touch-action':
|
|
1039
|
+
'@defaults touch-action': {
|
|
1040
|
+
},
|
|
1041
|
+
'--tw-pan-y': 'pan-y',
|
|
1042
|
+
'touch-action': 'var(--tw-touch-action)'
|
|
1028
1043
|
},
|
|
1029
1044
|
'.touch-pan-up': {
|
|
1030
|
-
'touch-action':
|
|
1045
|
+
'@defaults touch-action': {
|
|
1046
|
+
},
|
|
1047
|
+
'--tw-pan-y': 'pan-up',
|
|
1048
|
+
'touch-action': 'var(--tw-touch-action)'
|
|
1031
1049
|
},
|
|
1032
1050
|
'.touch-pan-down': {
|
|
1033
|
-
'touch-action':
|
|
1051
|
+
'@defaults touch-action': {
|
|
1052
|
+
},
|
|
1053
|
+
'--tw-pan-y': 'pan-down',
|
|
1054
|
+
'touch-action': 'var(--tw-touch-action)'
|
|
1034
1055
|
},
|
|
1035
1056
|
'.touch-pinch-zoom': {
|
|
1036
|
-
'touch-action':
|
|
1057
|
+
'@defaults touch-action': {
|
|
1058
|
+
},
|
|
1059
|
+
'--tw-pinch-zoom': 'pinch-zoom',
|
|
1060
|
+
'touch-action': 'var(--tw-touch-action)'
|
|
1037
1061
|
},
|
|
1038
1062
|
'.touch-manipulation': {
|
|
1039
1063
|
'touch-action': 'manipulation'
|
|
@@ -1657,10 +1681,10 @@ let corePlugins = {
|
|
|
1657
1681
|
}
|
|
1658
1682
|
});
|
|
1659
1683
|
},
|
|
1660
|
-
divideColor: ({ matchUtilities , theme , corePlugins })=>{
|
|
1684
|
+
divideColor: ({ matchUtilities , theme , corePlugins: corePlugins1 })=>{
|
|
1661
1685
|
matchUtilities({
|
|
1662
1686
|
divide: (value)=>{
|
|
1663
|
-
if (!
|
|
1687
|
+
if (!corePlugins1('divideOpacity')) {
|
|
1664
1688
|
return {
|
|
1665
1689
|
['& > :not([hidden]) ~ :not([hidden])']: {
|
|
1666
1690
|
'border-color': (0, _toColorValue).default(value)
|
|
@@ -2071,8 +2095,8 @@ let corePlugins = {
|
|
|
2071
2095
|
}
|
|
2072
2096
|
});
|
|
2073
2097
|
},
|
|
2074
|
-
borderColor: ({ addBase , matchUtilities , theme , corePlugins })=>{
|
|
2075
|
-
if (!
|
|
2098
|
+
borderColor: ({ addBase , matchUtilities , theme , corePlugins: corePlugins2 })=>{
|
|
2099
|
+
if (!corePlugins2('borderOpacity')) {
|
|
2076
2100
|
let value = theme('borderColor.DEFAULT', 'currentColor');
|
|
2077
2101
|
addBase({
|
|
2078
2102
|
'@defaults border-width': {
|
|
@@ -2090,7 +2114,7 @@ let corePlugins = {
|
|
|
2090
2114
|
}
|
|
2091
2115
|
matchUtilities({
|
|
2092
2116
|
border: (value)=>{
|
|
2093
|
-
if (!
|
|
2117
|
+
if (!corePlugins2('borderOpacity')) {
|
|
2094
2118
|
return {
|
|
2095
2119
|
'border-color': (0, _toColorValue).default(value)
|
|
2096
2120
|
};
|
|
@@ -2110,7 +2134,7 @@ let corePlugins = {
|
|
|
2110
2134
|
});
|
|
2111
2135
|
matchUtilities({
|
|
2112
2136
|
'border-x': (value)=>{
|
|
2113
|
-
if (!
|
|
2137
|
+
if (!corePlugins2('borderOpacity')) {
|
|
2114
2138
|
return {
|
|
2115
2139
|
'border-left-color': (0, _toColorValue).default(value),
|
|
2116
2140
|
'border-right-color': (0, _toColorValue).default(value)
|
|
@@ -2126,7 +2150,7 @@ let corePlugins = {
|
|
|
2126
2150
|
});
|
|
2127
2151
|
},
|
|
2128
2152
|
'border-y': (value)=>{
|
|
2129
|
-
if (!
|
|
2153
|
+
if (!corePlugins2('borderOpacity')) {
|
|
2130
2154
|
return {
|
|
2131
2155
|
'border-top-color': (0, _toColorValue).default(value),
|
|
2132
2156
|
'border-bottom-color': (0, _toColorValue).default(value)
|
|
@@ -2148,7 +2172,7 @@ let corePlugins = {
|
|
|
2148
2172
|
});
|
|
2149
2173
|
matchUtilities({
|
|
2150
2174
|
'border-t': (value)=>{
|
|
2151
|
-
if (!
|
|
2175
|
+
if (!corePlugins2('borderOpacity')) {
|
|
2152
2176
|
return {
|
|
2153
2177
|
'border-top-color': (0, _toColorValue).default(value)
|
|
2154
2178
|
};
|
|
@@ -2160,7 +2184,7 @@ let corePlugins = {
|
|
|
2160
2184
|
});
|
|
2161
2185
|
},
|
|
2162
2186
|
'border-r': (value)=>{
|
|
2163
|
-
if (!
|
|
2187
|
+
if (!corePlugins2('borderOpacity')) {
|
|
2164
2188
|
return {
|
|
2165
2189
|
'border-right-color': (0, _toColorValue).default(value)
|
|
2166
2190
|
};
|
|
@@ -2172,7 +2196,7 @@ let corePlugins = {
|
|
|
2172
2196
|
});
|
|
2173
2197
|
},
|
|
2174
2198
|
'border-b': (value)=>{
|
|
2175
|
-
if (!
|
|
2199
|
+
if (!corePlugins2('borderOpacity')) {
|
|
2176
2200
|
return {
|
|
2177
2201
|
'border-bottom-color': (0, _toColorValue).default(value)
|
|
2178
2202
|
};
|
|
@@ -2184,7 +2208,7 @@ let corePlugins = {
|
|
|
2184
2208
|
});
|
|
2185
2209
|
},
|
|
2186
2210
|
'border-l': (value)=>{
|
|
2187
|
-
if (!
|
|
2211
|
+
if (!corePlugins2('borderOpacity')) {
|
|
2188
2212
|
return {
|
|
2189
2213
|
'border-left-color': (0, _toColorValue).default(value)
|
|
2190
2214
|
};
|
|
@@ -2209,10 +2233,10 @@ let corePlugins = {
|
|
|
2209
2233
|
]
|
|
2210
2234
|
],
|
|
2211
2235
|
]),
|
|
2212
|
-
backgroundColor: ({ matchUtilities , theme , corePlugins })=>{
|
|
2236
|
+
backgroundColor: ({ matchUtilities , theme , corePlugins: corePlugins3 })=>{
|
|
2213
2237
|
matchUtilities({
|
|
2214
2238
|
bg: (value)=>{
|
|
2215
|
-
if (!
|
|
2239
|
+
if (!corePlugins3('backgroundOpacity')) {
|
|
2216
2240
|
return {
|
|
2217
2241
|
'background-color': (0, _toColorValue).default(value)
|
|
2218
2242
|
};
|
|
@@ -2293,6 +2317,12 @@ let corePlugins = {
|
|
|
2293
2317
|
},
|
|
2294
2318
|
'.decoration-clone': {
|
|
2295
2319
|
'box-decoration-break': 'clone'
|
|
2320
|
+
},
|
|
2321
|
+
'.box-decoration-slice': {
|
|
2322
|
+
'box-decoration-break': 'slice'
|
|
2323
|
+
},
|
|
2324
|
+
'.box-decoration-clone': {
|
|
2325
|
+
'box-decoration-break': 'clone'
|
|
2296
2326
|
}
|
|
2297
2327
|
});
|
|
2298
2328
|
},
|
|
@@ -2732,10 +2762,10 @@ let corePlugins = {
|
|
|
2732
2762
|
], {
|
|
2733
2763
|
supportsNegativeValues: true
|
|
2734
2764
|
}),
|
|
2735
|
-
textColor: ({ matchUtilities , theme , corePlugins })=>{
|
|
2765
|
+
textColor: ({ matchUtilities , theme , corePlugins: corePlugins4 })=>{
|
|
2736
2766
|
matchUtilities({
|
|
2737
2767
|
text: (value)=>{
|
|
2738
|
-
if (!
|
|
2768
|
+
if (!corePlugins4('textOpacity')) {
|
|
2739
2769
|
return {
|
|
2740
2770
|
color: (0, _toColorValue).default(value)
|
|
2741
2771
|
};
|
|
@@ -2764,6 +2794,9 @@ let corePlugins = {
|
|
|
2764
2794
|
'.underline': {
|
|
2765
2795
|
'text-decoration': 'underline'
|
|
2766
2796
|
},
|
|
2797
|
+
'.overline': {
|
|
2798
|
+
'text-decoration': 'overline'
|
|
2799
|
+
},
|
|
2767
2800
|
'.line-through': {
|
|
2768
2801
|
'text-decoration': 'line-through'
|
|
2769
2802
|
},
|
|
@@ -2782,11 +2815,55 @@ let corePlugins = {
|
|
|
2782
2815
|
}, {
|
|
2783
2816
|
values: (0, _flattenColorPalette).default(theme('textDecorationColor')),
|
|
2784
2817
|
type: [
|
|
2785
|
-
'color'
|
|
2786
|
-
'any'
|
|
2818
|
+
'color'
|
|
2787
2819
|
]
|
|
2788
2820
|
});
|
|
2789
2821
|
},
|
|
2822
|
+
textDecorationStyle: ({ addUtilities })=>{
|
|
2823
|
+
addUtilities({
|
|
2824
|
+
'.decoration-solid': {
|
|
2825
|
+
'text-decoration-style': 'solid'
|
|
2826
|
+
},
|
|
2827
|
+
'.decoration-double': {
|
|
2828
|
+
'text-decoration-style': 'double'
|
|
2829
|
+
},
|
|
2830
|
+
'.decoration-dotted': {
|
|
2831
|
+
'text-decoration-style': 'dotted'
|
|
2832
|
+
},
|
|
2833
|
+
'.decoration-dashed': {
|
|
2834
|
+
'text-decoration-style': 'dashed'
|
|
2835
|
+
},
|
|
2836
|
+
'.decoration-wavy': {
|
|
2837
|
+
'text-decoration-style': 'wavy'
|
|
2838
|
+
}
|
|
2839
|
+
});
|
|
2840
|
+
},
|
|
2841
|
+
textDecorationThickness: (0, _createUtilityPlugin).default('textDecorationThickness', [
|
|
2842
|
+
[
|
|
2843
|
+
'decoration',
|
|
2844
|
+
[
|
|
2845
|
+
'text-decoration-thickness'
|
|
2846
|
+
]
|
|
2847
|
+
]
|
|
2848
|
+
], {
|
|
2849
|
+
type: [
|
|
2850
|
+
'length',
|
|
2851
|
+
'percentage'
|
|
2852
|
+
]
|
|
2853
|
+
}),
|
|
2854
|
+
textUnderlineOffset: (0, _createUtilityPlugin).default('textUnderlineOffset', [
|
|
2855
|
+
[
|
|
2856
|
+
'underline-offset',
|
|
2857
|
+
[
|
|
2858
|
+
'text-underline-offset'
|
|
2859
|
+
]
|
|
2860
|
+
]
|
|
2861
|
+
], {
|
|
2862
|
+
type: [
|
|
2863
|
+
'length',
|
|
2864
|
+
'percentage'
|
|
2865
|
+
]
|
|
2866
|
+
}),
|
|
2790
2867
|
fontSmoothing: ({ addUtilities })=>{
|
|
2791
2868
|
addUtilities({
|
|
2792
2869
|
'.antialiased': {
|
|
@@ -2799,10 +2876,10 @@ let corePlugins = {
|
|
|
2799
2876
|
}
|
|
2800
2877
|
});
|
|
2801
2878
|
},
|
|
2802
|
-
placeholderColor: ({ matchUtilities , theme , corePlugins })=>{
|
|
2879
|
+
placeholderColor: ({ matchUtilities , theme , corePlugins: corePlugins5 })=>{
|
|
2803
2880
|
matchUtilities({
|
|
2804
2881
|
placeholder: (value)=>{
|
|
2805
|
-
if (!
|
|
2882
|
+
if (!corePlugins5('placeholderOpacity')) {
|
|
2806
2883
|
return {
|
|
2807
2884
|
'&::placeholder': {
|
|
2808
2885
|
color: (0, _toColorValue).default(value)
|
|
@@ -2992,38 +3069,115 @@ let corePlugins = {
|
|
|
2992
3069
|
'@defaults box-shadow': {
|
|
2993
3070
|
'--tw-ring-offset-shadow': '0 0 #0000',
|
|
2994
3071
|
'--tw-ring-shadow': '0 0 #0000',
|
|
2995
|
-
'--tw-shadow': '0 0 #0000'
|
|
3072
|
+
'--tw-shadow': '0 0 #0000',
|
|
3073
|
+
'--tw-shadow-colored': '0 0 #0000'
|
|
2996
3074
|
}
|
|
2997
3075
|
});
|
|
2998
3076
|
matchUtilities({
|
|
2999
3077
|
shadow: (value)=>{
|
|
3000
3078
|
value = transformValue(value);
|
|
3079
|
+
let ast = (0, _parseBoxShadowValue).parseBoxShadowValue(value);
|
|
3080
|
+
for (let shadow of ast){
|
|
3081
|
+
// Don't override color if the whole shadow is a variable
|
|
3082
|
+
if (!shadow.valid) {
|
|
3083
|
+
continue;
|
|
3084
|
+
}
|
|
3085
|
+
shadow.color = 'var(--tw-shadow-color)';
|
|
3086
|
+
}
|
|
3001
3087
|
return {
|
|
3002
3088
|
'@defaults box-shadow': {
|
|
3003
3089
|
},
|
|
3004
3090
|
'--tw-shadow': value === 'none' ? '0 0 #0000' : value,
|
|
3091
|
+
'--tw-shadow-colored': value === 'none' ? '0 0 #0000' : (0, _parseBoxShadowValue).formatBoxShadowValue(ast),
|
|
3005
3092
|
'box-shadow': defaultBoxShadow
|
|
3006
3093
|
};
|
|
3007
3094
|
}
|
|
3008
3095
|
}, {
|
|
3009
|
-
values: theme('boxShadow')
|
|
3096
|
+
values: theme('boxShadow'),
|
|
3097
|
+
type: [
|
|
3098
|
+
'shadow'
|
|
3099
|
+
]
|
|
3010
3100
|
});
|
|
3011
3101
|
};
|
|
3012
3102
|
})(),
|
|
3013
|
-
|
|
3103
|
+
boxShadowColor: ({ matchUtilities , theme })=>{
|
|
3104
|
+
matchUtilities({
|
|
3105
|
+
shadow: (value)=>{
|
|
3106
|
+
return {
|
|
3107
|
+
'--tw-shadow-color': (0, _toColorValue).default(value),
|
|
3108
|
+
'--tw-shadow': 'var(--tw-shadow-colored)'
|
|
3109
|
+
};
|
|
3110
|
+
}
|
|
3111
|
+
}, {
|
|
3112
|
+
values: (0, _flattenColorPalette).default(theme('boxShadowColor')),
|
|
3113
|
+
type: [
|
|
3114
|
+
'color'
|
|
3115
|
+
]
|
|
3116
|
+
});
|
|
3117
|
+
},
|
|
3118
|
+
outlineStyle: ({ addUtilities })=>{
|
|
3119
|
+
addUtilities({
|
|
3120
|
+
'.outline-none': {
|
|
3121
|
+
outline: '2px solid transparent',
|
|
3122
|
+
'outline-offset': '2px'
|
|
3123
|
+
},
|
|
3124
|
+
'.outline': {
|
|
3125
|
+
'outline-style': 'solid'
|
|
3126
|
+
},
|
|
3127
|
+
'.outline-dashed': {
|
|
3128
|
+
'outline-style': 'dashed'
|
|
3129
|
+
},
|
|
3130
|
+
'.outline-dotted': {
|
|
3131
|
+
'outline-style': 'dotted'
|
|
3132
|
+
},
|
|
3133
|
+
'.outline-double': {
|
|
3134
|
+
'outline-style': 'double'
|
|
3135
|
+
},
|
|
3136
|
+
'.outline-hidden': {
|
|
3137
|
+
'outline-style': 'hidden'
|
|
3138
|
+
}
|
|
3139
|
+
});
|
|
3140
|
+
},
|
|
3141
|
+
outlineWidth: (0, _createUtilityPlugin).default('outlineWidth', [
|
|
3142
|
+
[
|
|
3143
|
+
'outline',
|
|
3144
|
+
[
|
|
3145
|
+
'outline-width'
|
|
3146
|
+
]
|
|
3147
|
+
]
|
|
3148
|
+
], {
|
|
3149
|
+
type: [
|
|
3150
|
+
'length',
|
|
3151
|
+
'number',
|
|
3152
|
+
'percentage'
|
|
3153
|
+
]
|
|
3154
|
+
}),
|
|
3155
|
+
outlineOffset: (0, _createUtilityPlugin).default('outlineOffset', [
|
|
3156
|
+
[
|
|
3157
|
+
'outline-offset',
|
|
3158
|
+
[
|
|
3159
|
+
'outline-offset'
|
|
3160
|
+
]
|
|
3161
|
+
]
|
|
3162
|
+
], {
|
|
3163
|
+
type: [
|
|
3164
|
+
'length',
|
|
3165
|
+
'number',
|
|
3166
|
+
'percentage'
|
|
3167
|
+
]
|
|
3168
|
+
}),
|
|
3169
|
+
outlineColor: ({ matchUtilities , theme })=>{
|
|
3014
3170
|
matchUtilities({
|
|
3015
3171
|
outline: (value)=>{
|
|
3016
|
-
value = Array.isArray(value) ? value : value.split(',');
|
|
3017
|
-
let [outline, outlineOffset = '0'] = Array.isArray(value) ? value : [
|
|
3018
|
-
value
|
|
3019
|
-
];
|
|
3020
3172
|
return {
|
|
3021
|
-
outline,
|
|
3022
|
-
'outline-offset': outlineOffset
|
|
3173
|
+
'outline-color': (0, _toColorValue).default(value)
|
|
3023
3174
|
};
|
|
3024
3175
|
}
|
|
3025
3176
|
}, {
|
|
3026
|
-
values: theme('
|
|
3177
|
+
values: (0, _flattenColorPalette).default(theme('outlineColor')),
|
|
3178
|
+
type: [
|
|
3179
|
+
'color'
|
|
3180
|
+
]
|
|
3027
3181
|
});
|
|
3028
3182
|
},
|
|
3029
3183
|
ringWidth: ({ matchUtilities , addBase , addUtilities , theme })=>{
|
|
@@ -3037,7 +3191,8 @@ let corePlugins = {
|
|
|
3037
3191
|
'--tw-ring-color': ringColorDefault,
|
|
3038
3192
|
'--tw-ring-offset-shadow': '0 0 #0000',
|
|
3039
3193
|
'--tw-ring-shadow': '0 0 #0000',
|
|
3040
|
-
'--tw-shadow': '0 0 #0000'
|
|
3194
|
+
'--tw-shadow': '0 0 #0000',
|
|
3195
|
+
'--tw-shadow-colored': '0 0 #0000'
|
|
3041
3196
|
}
|
|
3042
3197
|
});
|
|
3043
3198
|
matchUtilities({
|
package/lib/css/preflight.css
CHANGED
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
|
}
|
package/lib/lib/detectNesting.js
CHANGED
|
@@ -6,12 +6,27 @@ exports.default = _default;
|
|
|
6
6
|
function _default(_context) {
|
|
7
7
|
return (root, result)=>{
|
|
8
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
|
+
});
|
|
9
21
|
root.walkRules((rule)=>{
|
|
10
22
|
if (found) return false;
|
|
11
23
|
rule.walkRules((nestedRule)=>{
|
|
12
24
|
found = true;
|
|
13
|
-
nestedRule.warn(result,
|
|
14
|
-
|
|
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'));
|
|
15
30
|
return false;
|
|
16
31
|
});
|
|
17
32
|
});
|
|
@@ -7,6 +7,7 @@ var _dlv = _interopRequireDefault(require("dlv"));
|
|
|
7
7
|
var _didyoumean = _interopRequireDefault(require("didyoumean"));
|
|
8
8
|
var _transformThemeValue = _interopRequireDefault(require("../util/transformThemeValue"));
|
|
9
9
|
var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser"));
|
|
10
|
+
var _normalizeScreens = require("../util/normalizeScreens");
|
|
10
11
|
var _buildMediaQuery = _interopRequireDefault(require("../util/buildMediaQuery"));
|
|
11
12
|
var _toPath = require("../util/toPath");
|
|
12
13
|
function _interopRequireDefault(obj) {
|
|
@@ -112,11 +113,11 @@ function extractArgs(node, vNodes, functions) {
|
|
|
112
113
|
let args = [
|
|
113
114
|
''
|
|
114
115
|
];
|
|
115
|
-
for (let
|
|
116
|
-
if (
|
|
116
|
+
for (let vNode1 of vNodes){
|
|
117
|
+
if (vNode1.type === 'div' && vNode1.value === ',') {
|
|
117
118
|
args.push('');
|
|
118
119
|
} else {
|
|
119
|
-
args[args.length - 1] += _postcssValueParser.default.stringify(
|
|
120
|
+
args[args.length - 1] += _postcssValueParser.default.stringify(vNode1);
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
return args;
|
|
@@ -149,10 +150,13 @@ function _default({ tailwindConfig: config }) {
|
|
|
149
150
|
},
|
|
150
151
|
screen: (node, screen)=>{
|
|
151
152
|
screen = screen.replace(/^['"]+/g, '').replace(/['"]+$/g, '');
|
|
152
|
-
|
|
153
|
+
let screens = (0, _normalizeScreens).normalizeScreens(config.theme.screens);
|
|
154
|
+
let screenDefinition = screens.find(({ name })=>name === screen
|
|
155
|
+
);
|
|
156
|
+
if (!screenDefinition) {
|
|
153
157
|
throw node.error(`The '${screen}' screen does not exist in your theme.`);
|
|
154
158
|
}
|
|
155
|
-
return (0, _buildMediaQuery).default(
|
|
159
|
+
return (0, _buildMediaQuery).default(screenDefinition);
|
|
156
160
|
}
|
|
157
161
|
};
|
|
158
162
|
return (root)=>{
|