tailwindcss 0.0.0-insiders.f9fb2ce → 0.0.0-insiders.fb545bc

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +84 -3
  2. package/colors.js +2 -1
  3. package/defaultConfig.js +2 -1
  4. package/defaultTheme.js +2 -1
  5. package/lib/cli.js +32 -32
  6. package/lib/constants.js +1 -1
  7. package/lib/corePluginList.js +4 -0
  8. package/lib/corePlugins.js +257 -172
  9. package/lib/css/preflight.css +4 -3
  10. package/lib/featureFlags.js +6 -4
  11. package/lib/lib/collapseDuplicateDeclarations.js +2 -2
  12. package/lib/lib/detectNesting.js +17 -2
  13. package/lib/lib/evaluateTailwindFunctions.js +9 -5
  14. package/lib/lib/expandApplyAtRules.js +26 -9
  15. package/lib/lib/expandTailwindAtRules.js +27 -1
  16. package/lib/lib/generateRules.js +64 -10
  17. package/lib/lib/resolveDefaultsAtRules.js +25 -11
  18. package/lib/lib/setupContextUtils.js +55 -78
  19. package/lib/lib/sharedState.js +1 -1
  20. package/lib/lib/substituteScreenAtRules.js +7 -4
  21. package/lib/util/buildMediaQuery.js +13 -24
  22. package/lib/util/createUtilityPlugin.js +2 -2
  23. package/lib/util/dataTypes.js +25 -3
  24. package/lib/util/defaults.js +6 -0
  25. package/lib/util/formatVariantSelector.js +93 -9
  26. package/lib/util/isValidArbitraryValue.js +64 -0
  27. package/lib/util/log.js +4 -0
  28. package/lib/util/nameClass.js +1 -0
  29. package/lib/util/normalizeConfig.js +41 -12
  30. package/lib/util/normalizeScreens.js +61 -0
  31. package/lib/util/parseBoxShadowValue.js +77 -0
  32. package/lib/util/pluginUtils.js +12 -11
  33. package/lib/util/resolveConfig.js +12 -12
  34. package/package.json +15 -14
  35. package/peers/index.js +3798 -3098
  36. package/plugin.js +2 -1
  37. package/resolveConfig.js +2 -1
  38. package/src/corePluginList.js +1 -1
  39. package/src/corePlugins.js +232 -164
  40. package/src/css/preflight.css +4 -3
  41. package/src/featureFlags.js +5 -1
  42. package/src/lib/detectNesting.js +22 -3
  43. package/src/lib/evaluateTailwindFunctions.js +5 -2
  44. package/src/lib/expandApplyAtRules.js +29 -2
  45. package/src/lib/expandTailwindAtRules.js +25 -0
  46. package/src/lib/generateRules.js +57 -0
  47. package/src/lib/resolveDefaultsAtRules.js +28 -7
  48. package/src/lib/setupContextUtils.js +45 -64
  49. package/src/lib/substituteScreenAtRules.js +6 -3
  50. package/src/util/buildMediaQuery.js +14 -18
  51. package/src/util/dataTypes.js +24 -6
  52. package/src/util/defaults.js +6 -0
  53. package/src/util/formatVariantSelector.js +92 -1
  54. package/src/util/isValidArbitraryValue.js +61 -0
  55. package/src/util/log.js +4 -0
  56. package/src/util/nameClass.js +1 -1
  57. package/src/util/normalizeConfig.js +14 -1
  58. package/src/util/normalizeScreens.js +45 -0
  59. package/src/util/parseBoxShadowValue.js +71 -0
  60. package/src/util/pluginUtils.js +2 -0
  61. package/stubs/defaultConfig.stub.js +23 -5
package/plugin.js CHANGED
@@ -1 +1,2 @@
1
- module.exports = require('./lib/public/create-plugin').default
1
+ let createPlugin = require('./lib/public/create-plugin')
2
+ module.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default
package/resolveConfig.js CHANGED
@@ -1 +1,2 @@
1
- module.exports = require('./lib/public/resolve-config').default
1
+ let resolveConfig = require('./lib/public/resolve-config')
2
+ module.exports = (resolveConfig.__esModule ? resolveConfig : { default: resolveConfig }).default
@@ -1 +1 @@
1
- export default ["preflight","container","accessibility","pointerEvents","visibility","position","inset","isolation","zIndex","order","gridColumn","gridColumnStart","gridColumnEnd","gridRow","gridRowStart","gridRowEnd","float","clear","margin","boxSizing","display","aspectRatio","height","maxHeight","minHeight","width","minWidth","maxWidth","flex","flexShrink","flexGrow","flexBasis","tableLayout","borderCollapse","transformOrigin","translate","rotate","skew","scale","transform","animation","cursor","touchAction","userSelect","resize","scrollSnapType","scrollSnapAlign","scrollSnapStop","scrollMargin","scrollPadding","listStylePosition","listStyleType","appearance","columns","breakBefore","breakInside","breakAfter","gridAutoColumns","gridAutoFlow","gridAutoRows","gridTemplateColumns","gridTemplateRows","flexDirection","flexWrap","placeContent","placeItems","alignContent","alignItems","justifyContent","justifyItems","gap","space","divideWidth","divideStyle","divideColor","divideOpacity","placeSelf","alignSelf","justifySelf","overflow","overscrollBehavior","scrollBehavior","textOverflow","whitespace","wordBreak","borderRadius","borderWidth","borderStyle","borderColor","borderOpacity","backgroundColor","backgroundOpacity","backgroundImage","gradientColorStops","boxDecorationBreak","backgroundSize","backgroundAttachment","backgroundClip","backgroundPosition","backgroundRepeat","backgroundOrigin","fill","stroke","strokeWidth","objectFit","objectPosition","padding","textAlign","textIndent","verticalAlign","fontFamily","fontSize","fontWeight","textTransform","fontStyle","fontVariantNumeric","lineHeight","letterSpacing","textColor","textOpacity","textDecoration","textDecorationColor","fontSmoothing","placeholderColor","placeholderOpacity","caretColor","accentColor","opacity","backgroundBlendMode","mixBlendMode","boxShadow","outlineStyle","outlineWidth","outlineOffset","outlineColor","ringWidth","ringColor","ringOpacity","ringOffsetWidth","ringOffsetColor","blur","brightness","contrast","dropShadow","grayscale","hueRotate","invert","saturate","sepia","filter","backdropBlur","backdropBrightness","backdropContrast","backdropGrayscale","backdropHueRotate","backdropInvert","backdropOpacity","backdropSaturate","backdropSepia","backdropFilter","transitionProperty","transitionDelay","transitionDuration","transitionTimingFunction","willChange","content"]
1
+ export default ["preflight","container","accessibility","pointerEvents","visibility","position","inset","isolation","zIndex","order","gridColumn","gridColumnStart","gridColumnEnd","gridRow","gridRowStart","gridRowEnd","float","clear","margin","boxSizing","display","aspectRatio","height","maxHeight","minHeight","width","minWidth","maxWidth","flex","flexShrink","flexGrow","flexBasis","tableLayout","borderCollapse","transformOrigin","translate","rotate","skew","scale","transform","animation","cursor","touchAction","userSelect","resize","scrollSnapType","scrollSnapAlign","scrollSnapStop","scrollMargin","scrollPadding","listStylePosition","listStyleType","appearance","columns","breakBefore","breakInside","breakAfter","gridAutoColumns","gridAutoFlow","gridAutoRows","gridTemplateColumns","gridTemplateRows","flexDirection","flexWrap","placeContent","placeItems","alignContent","alignItems","justifyContent","justifyItems","gap","space","divideWidth","divideStyle","divideColor","divideOpacity","placeSelf","alignSelf","justifySelf","overflow","overscrollBehavior","scrollBehavior","textOverflow","whitespace","wordBreak","borderRadius","borderWidth","borderStyle","borderColor","borderOpacity","backgroundColor","backgroundOpacity","backgroundImage","gradientColorStops","boxDecorationBreak","backgroundSize","backgroundAttachment","backgroundClip","backgroundPosition","backgroundRepeat","backgroundOrigin","fill","stroke","strokeWidth","objectFit","objectPosition","padding","textAlign","textIndent","verticalAlign","fontFamily","fontSize","fontWeight","textTransform","fontStyle","fontVariantNumeric","lineHeight","letterSpacing","textColor","textOpacity","textDecoration","textDecorationColor","textDecorationStyle","textDecorationThickness","textUnderlineOffset","fontSmoothing","placeholderColor","placeholderOpacity","caretColor","accentColor","opacity","backgroundBlendMode","mixBlendMode","boxShadow","boxShadowColor","outlineStyle","outlineWidth","outlineOffset","outlineColor","ringWidth","ringColor","ringOpacity","ringOffsetWidth","ringOffsetColor","blur","brightness","contrast","dropShadow","grayscale","hueRotate","invert","saturate","sepia","filter","backdropBlur","backdropBrightness","backdropContrast","backdropGrayscale","backdropHueRotate","backdropInvert","backdropOpacity","backdropSaturate","backdropSepia","backdropFilter","transitionProperty","transitionDelay","transitionDuration","transitionTimingFunction","willChange","content"]
@@ -11,6 +11,8 @@ import isPlainObject from './util/isPlainObject'
11
11
  import transformThemeValue from './util/transformThemeValue'
12
12
  import { version as tailwindVersion } from '../package.json'
13
13
  import log from './util/log'
14
+ import { normalizeScreens } from './util/normalizeScreens'
15
+ import { formatBoxShadowValue, parseBoxShadowValue } from './util/parseBoxShadowValue'
14
16
 
15
17
  export let variantPlugins = {
16
18
  pseudoElementVariants: ({ addVariant }) => {
@@ -22,6 +24,8 @@ export let variantPlugins = {
22
24
 
23
25
  addVariant('file', '&::file-selector-button')
24
26
 
27
+ addVariant('placeholder', '&::placeholder')
28
+
25
29
  addVariant('before', ({ container }) => {
26
30
  container.walkRules((rule) => {
27
31
  let foundContent = false
@@ -155,13 +159,17 @@ export let variantPlugins = {
155
159
  },
156
160
 
157
161
  screenVariants: ({ theme, addVariant }) => {
158
- for (let screen in theme('screens')) {
159
- let size = theme('screens')[screen]
160
- let query = buildMediaQuery(size)
162
+ for (let screen of normalizeScreens(theme('screens'))) {
163
+ let query = buildMediaQuery(screen)
161
164
 
162
- addVariant(screen, `@media ${query}`)
165
+ addVariant(screen.name, `@media ${query}`)
163
166
  }
164
167
  },
168
+
169
+ orientationVariants: ({ addVariant }) => {
170
+ addVariant('portrait', '@media (orientation: portrait)')
171
+ addVariant('landscape', '@media (orientation: landscape)')
172
+ },
165
173
  }
166
174
 
167
175
  export let corePlugins = {
@@ -179,24 +187,10 @@ export let corePlugins = {
179
187
  },
180
188
 
181
189
  container: (() => {
182
- function extractMinWidths(breakpoints) {
183
- return Object.values(breakpoints ?? {}).flatMap((breakpoints) => {
184
- if (typeof breakpoints === 'string') {
185
- breakpoints = { min: breakpoints }
186
- }
187
-
188
- if (!Array.isArray(breakpoints)) {
189
- breakpoints = [breakpoints]
190
- }
191
-
192
- return breakpoints
193
- .filter((breakpoint) => {
194
- return breakpoint?.hasOwnProperty?.('min') || breakpoint?.hasOwnProperty('min-width')
195
- })
196
- .map((breakpoint) => {
197
- return breakpoint['min-width'] ?? breakpoint.min
198
- })
199
- })
190
+ function extractMinWidths(breakpoints = []) {
191
+ return breakpoints
192
+ .flatMap((breakpoint) => breakpoint.values.map((breakpoint) => breakpoint.min))
193
+ .filter((v) => v !== undefined)
200
194
  }
201
195
 
202
196
  function mapMinWidthsToPadding(minWidths, screens, paddings) {
@@ -225,16 +219,11 @@ export let corePlugins = {
225
219
  }
226
220
 
227
221
  for (let minWidth of minWidths) {
228
- for (let [screen, value] of Object.entries(screens)) {
229
- let screenMinWidth =
230
- typeof value === 'object' && value !== null ? value.min || value['min-width'] : value
231
-
232
- if (`${screenMinWidth}` === `${minWidth}`) {
233
- mapping.push({
234
- screen,
235
- minWidth,
236
- padding: paddings[screen],
237
- })
222
+ for (let screen of screens) {
223
+ for (let { min } of screen.values) {
224
+ if (min === minWidth) {
225
+ mapping.push({ minWidth, padding: paddings[screen.name] })
226
+ }
238
227
  }
239
228
  }
240
229
  }
@@ -243,12 +232,12 @@ export let corePlugins = {
243
232
  }
244
233
 
245
234
  return function ({ addComponents, theme }) {
246
- let screens = theme('container.screens', theme('screens'))
235
+ let screens = normalizeScreens(theme('container.screens', theme('screens')))
247
236
  let minWidths = extractMinWidths(screens)
248
237
  let paddings = mapMinWidthsToPadding(minWidths, screens, theme('container.padding'))
249
238
 
250
239
  let generatePaddingFor = (minWidth) => {
251
- let paddingConfig = paddings.find((padding) => `${padding.minWidth}` === `${minWidth}`)
240
+ let paddingConfig = paddings.find((padding) => padding.minWidth === minWidth)
252
241
 
253
242
  if (!paddingConfig) {
254
243
  return {}
@@ -514,49 +503,52 @@ export let corePlugins = {
514
503
  ],
515
504
  { supportsNegativeValues: true }
516
505
  ),
517
- scale: createUtilityPlugin('scale', [
518
- [
519
- 'scale',
520
- [
521
- ['@defaults transform', {}],
522
- '--tw-scale-x',
523
- '--tw-scale-y',
524
- ['transform', 'var(--tw-transform)'],
525
- ],
526
- ],
506
+ scale: createUtilityPlugin(
507
+ 'scale',
527
508
  [
528
509
  [
529
- 'scale-x',
530
- [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
510
+ 'scale',
511
+ [
512
+ ['@defaults transform', {}],
513
+ '--tw-scale-x',
514
+ '--tw-scale-y',
515
+ ['transform', 'var(--tw-transform)'],
516
+ ],
531
517
  ],
532
518
  [
533
- 'scale-y',
534
- [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']],
519
+ [
520
+ 'scale-x',
521
+ [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
522
+ ],
523
+ [
524
+ 'scale-y',
525
+ [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']],
526
+ ],
535
527
  ],
536
528
  ],
537
- ]),
529
+ { supportsNegativeValues: true }
530
+ ),
538
531
 
539
- transform: ({ addBase, addUtilities }) => {
540
- addBase({
541
- '@defaults transform': {
542
- '--tw-translate-x': '0',
543
- '--tw-translate-y': '0',
544
- '--tw-rotate': '0',
545
- '--tw-skew-x': '0',
546
- '--tw-skew-y': '0',
547
- '--tw-scale-x': '1',
548
- '--tw-scale-y': '1',
549
- '--tw-transform': [
550
- 'translateX(var(--tw-translate-x))',
551
- 'translateY(var(--tw-translate-y))',
552
- 'rotate(var(--tw-rotate))',
553
- 'skewX(var(--tw-skew-x))',
554
- 'skewY(var(--tw-skew-y))',
555
- 'scaleX(var(--tw-scale-x))',
556
- 'scaleY(var(--tw-scale-y))',
557
- ].join(' '),
558
- },
532
+ transform: ({ addDefaults, addUtilities }) => {
533
+ addDefaults('transform', {
534
+ '--tw-translate-x': '0',
535
+ '--tw-translate-y': '0',
536
+ '--tw-rotate': '0',
537
+ '--tw-skew-x': '0',
538
+ '--tw-skew-y': '0',
539
+ '--tw-scale-x': '1',
540
+ '--tw-scale-y': '1',
541
+ '--tw-transform': [
542
+ 'translateX(var(--tw-translate-x))',
543
+ 'translateY(var(--tw-translate-y))',
544
+ 'rotate(var(--tw-rotate))',
545
+ 'skewX(var(--tw-skew-x))',
546
+ 'skewY(var(--tw-skew-y))',
547
+ 'scaleX(var(--tw-scale-x))',
548
+ 'scaleY(var(--tw-scale-y))',
549
+ ].join(' '),
559
550
  })
551
+
560
552
  addUtilities({
561
553
  '.transform': { '@defaults transform': {}, transform: 'var(--tw-transform)' },
562
554
  '.transform-cpu': {
@@ -618,17 +610,52 @@ export let corePlugins = {
618
610
 
619
611
  cursor: createUtilityPlugin('cursor'),
620
612
 
621
- touchAction: ({ addUtilities }) => {
613
+ touchAction: ({ addDefaults, addUtilities }) => {
614
+ addDefaults('touch-action', {
615
+ '--tw-pan-x': 'var(--tw-empty,/*!*/ /*!*/)',
616
+ '--tw-pan-y': 'var(--tw-empty,/*!*/ /*!*/)',
617
+ '--tw-pinch-zoom': 'var(--tw-empty,/*!*/ /*!*/)',
618
+ '--tw-touch-action': 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)',
619
+ })
620
+
622
621
  addUtilities({
623
622
  '.touch-auto': { 'touch-action': 'auto' },
624
623
  '.touch-none': { 'touch-action': 'none' },
625
- '.touch-pan-x': { 'touch-action': 'pan-x' },
626
- '.touch-pan-left': { 'touch-action': 'pan-left' },
627
- '.touch-pan-right': { 'touch-action': 'pan-right' },
628
- '.touch-pan-y': { 'touch-action': 'pan-y' },
629
- '.touch-pan-up': { 'touch-action': 'pan-up' },
630
- '.touch-pan-down': { 'touch-action': 'pan-down' },
631
- '.touch-pinch-zoom': { 'touch-action': 'pinch-zoom' },
624
+ '.touch-pan-x': {
625
+ '@defaults touch-action': {},
626
+ '--tw-pan-x': 'pan-x',
627
+ 'touch-action': 'var(--tw-touch-action)',
628
+ },
629
+ '.touch-pan-left': {
630
+ '@defaults touch-action': {},
631
+ '--tw-pan-x': 'pan-left',
632
+ 'touch-action': 'var(--tw-touch-action)',
633
+ },
634
+ '.touch-pan-right': {
635
+ '@defaults touch-action': {},
636
+ '--tw-pan-x': 'pan-right',
637
+ 'touch-action': 'var(--tw-touch-action)',
638
+ },
639
+ '.touch-pan-y': {
640
+ '@defaults touch-action': {},
641
+ '--tw-pan-y': 'pan-y',
642
+ 'touch-action': 'var(--tw-touch-action)',
643
+ },
644
+ '.touch-pan-up': {
645
+ '@defaults touch-action': {},
646
+ '--tw-pan-y': 'pan-up',
647
+ 'touch-action': 'var(--tw-touch-action)',
648
+ },
649
+ '.touch-pan-down': {
650
+ '@defaults touch-action': {},
651
+ '--tw-pan-y': 'pan-down',
652
+ 'touch-action': 'var(--tw-touch-action)',
653
+ },
654
+ '.touch-pinch-zoom': {
655
+ '@defaults touch-action': {},
656
+ '--tw-pinch-zoom': 'pinch-zoom',
657
+ 'touch-action': 'var(--tw-touch-action)',
658
+ },
632
659
  '.touch-manipulation': { 'touch-action': 'manipulation' },
633
660
  })
634
661
  },
@@ -651,11 +678,9 @@ export let corePlugins = {
651
678
  })
652
679
  },
653
680
 
654
- scrollSnapType: ({ addUtilities, addBase }) => {
655
- addBase({
656
- '@defaults scroll-snap-type': {
657
- '--tw-scroll-snap-strictness': 'proximity',
658
- },
681
+ scrollSnapType: ({ addDefaults, addUtilities }) => {
682
+ addDefaults('scroll-snap-type', {
683
+ '--tw-scroll-snap-strictness': 'proximity',
659
684
  })
660
685
 
661
686
  addUtilities({
@@ -1152,22 +1177,21 @@ export let corePlugins = {
1152
1177
  })
1153
1178
  },
1154
1179
 
1155
- borderColor: ({ addBase, matchUtilities, theme, corePlugins }) => {
1180
+ borderColor: ({ addDefaults, matchUtilities, theme, corePlugins }) => {
1156
1181
  if (!corePlugins('borderOpacity')) {
1157
1182
  let value = theme('borderColor.DEFAULT', 'currentColor')
1158
- addBase({
1159
- '@defaults border-width': {
1160
- 'border-color': toColorValue(value),
1161
- },
1183
+ addDefaults('border-width', {
1184
+ 'border-color': toColorValue(value),
1162
1185
  })
1163
1186
  } else {
1164
- addBase({
1165
- '@defaults border-width': withAlphaVariable({
1187
+ addDefaults(
1188
+ 'border-width',
1189
+ withAlphaVariable({
1166
1190
  color: theme('borderColor.DEFAULT', 'currentColor'),
1167
1191
  property: 'border-color',
1168
1192
  variable: '--tw-border-opacity',
1169
- }),
1170
- })
1193
+ })
1194
+ )
1171
1195
  }
1172
1196
 
1173
1197
  matchUtilities(
@@ -1370,8 +1394,10 @@ export let corePlugins = {
1370
1394
 
1371
1395
  boxDecorationBreak: ({ addUtilities }) => {
1372
1396
  addUtilities({
1373
- '.decoration-slice': { 'box-decoration-break': 'slice' },
1374
- '.decoration-clone': { 'box-decoration-break': 'clone' },
1397
+ '.decoration-slice': { 'box-decoration-break': 'slice' }, // Deprecated
1398
+ '.decoration-clone': { 'box-decoration-break': 'clone' }, // Deprecated
1399
+ '.box-decoration-slice': { 'box-decoration-break': 'slice' },
1400
+ '.box-decoration-clone': { 'box-decoration-break': 'clone' },
1375
1401
  })
1376
1402
  },
1377
1403
 
@@ -1628,9 +1654,10 @@ export let corePlugins = {
1628
1654
 
1629
1655
  textDecoration: ({ addUtilities }) => {
1630
1656
  addUtilities({
1631
- '.underline': { 'text-decoration': 'underline' },
1632
- '.line-through': { 'text-decoration': 'line-through' },
1633
- '.no-underline': { 'text-decoration': 'none' },
1657
+ '.underline': { 'text-decoration-line': 'underline' },
1658
+ '.overline': { 'text-decoration-line': 'overline' },
1659
+ '.line-through': { 'text-decoration-line': 'line-through' },
1660
+ '.no-underline': { 'text-decoration-line': 'none' },
1634
1661
  })
1635
1662
  },
1636
1663
 
@@ -1641,10 +1668,32 @@ export let corePlugins = {
1641
1668
  return { 'text-decoration-color': toColorValue(value) }
1642
1669
  },
1643
1670
  },
1644
- { values: flattenColorPalette(theme('textDecorationColor')), type: ['color', 'any'] }
1671
+ { values: flattenColorPalette(theme('textDecorationColor')), type: ['color'] }
1645
1672
  )
1646
1673
  },
1647
1674
 
1675
+ textDecorationStyle: ({ addUtilities }) => {
1676
+ addUtilities({
1677
+ '.decoration-solid': { 'text-decoration-style': 'solid' },
1678
+ '.decoration-double': { 'text-decoration-style': 'double' },
1679
+ '.decoration-dotted': { 'text-decoration-style': 'dotted' },
1680
+ '.decoration-dashed': { 'text-decoration-style': 'dashed' },
1681
+ '.decoration-wavy': { 'text-decoration-style': 'wavy' },
1682
+ })
1683
+ },
1684
+
1685
+ textDecorationThickness: createUtilityPlugin(
1686
+ 'textDecorationThickness',
1687
+ [['decoration', ['text-decoration-thickness']]],
1688
+ { type: ['length', 'percentage'] }
1689
+ ),
1690
+
1691
+ textUnderlineOffset: createUtilityPlugin(
1692
+ 'textUnderlineOffset',
1693
+ [['underline-offset', ['text-underline-offset']]],
1694
+ { type: ['length', 'percentage'] }
1695
+ ),
1696
+
1648
1697
  fontSmoothing: ({ addUtilities }) => {
1649
1698
  addUtilities({
1650
1699
  '.antialiased': {
@@ -1768,13 +1817,12 @@ export let corePlugins = {
1768
1817
  `var(--tw-shadow)`,
1769
1818
  ].join(', ')
1770
1819
 
1771
- return function ({ matchUtilities, addBase, theme }) {
1772
- addBase({
1773
- '@defaults box-shadow': {
1774
- '--tw-ring-offset-shadow': '0 0 #0000',
1775
- '--tw-ring-shadow': '0 0 #0000',
1776
- '--tw-shadow': '0 0 #0000',
1777
- },
1820
+ return function ({ matchUtilities, addDefaults, theme }) {
1821
+ addDefaults(' box-shadow', {
1822
+ '--tw-ring-offset-shadow': '0 0 #0000',
1823
+ '--tw-ring-shadow': '0 0 #0000',
1824
+ '--tw-shadow': '0 0 #0000',
1825
+ '--tw-shadow-colored': '0 0 #0000',
1778
1826
  })
1779
1827
 
1780
1828
  matchUtilities(
@@ -1782,18 +1830,43 @@ export let corePlugins = {
1782
1830
  shadow: (value) => {
1783
1831
  value = transformValue(value)
1784
1832
 
1833
+ let ast = parseBoxShadowValue(value)
1834
+ for (let shadow of ast) {
1835
+ // Don't override color if the whole shadow is a variable
1836
+ if (!shadow.valid) {
1837
+ continue
1838
+ }
1839
+
1840
+ shadow.color = 'var(--tw-shadow-color)'
1841
+ }
1842
+
1785
1843
  return {
1786
1844
  '@defaults box-shadow': {},
1787
1845
  '--tw-shadow': value === 'none' ? '0 0 #0000' : value,
1846
+ '--tw-shadow-colored': value === 'none' ? '0 0 #0000' : formatBoxShadowValue(ast),
1788
1847
  'box-shadow': defaultBoxShadow,
1789
1848
  }
1790
1849
  },
1791
1850
  },
1792
- { values: theme('boxShadow') }
1851
+ { values: theme('boxShadow'), type: ['shadow'] }
1793
1852
  )
1794
1853
  }
1795
1854
  })(),
1796
1855
 
1856
+ boxShadowColor: ({ matchUtilities, theme }) => {
1857
+ matchUtilities(
1858
+ {
1859
+ shadow: (value) => {
1860
+ return {
1861
+ '--tw-shadow-color': toColorValue(value),
1862
+ '--tw-shadow': 'var(--tw-shadow-colored)',
1863
+ }
1864
+ },
1865
+ },
1866
+ { values: flattenColorPalette(theme('boxShadowColor')), type: ['color'] }
1867
+ )
1868
+ },
1869
+
1797
1870
  outlineStyle: ({ addUtilities }) => {
1798
1871
  addUtilities({
1799
1872
  '.outline-none': {
@@ -1827,7 +1900,7 @@ export let corePlugins = {
1827
1900
  )
1828
1901
  },
1829
1902
 
1830
- ringWidth: ({ matchUtilities, addBase, addUtilities, theme }) => {
1903
+ ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme }) => {
1831
1904
  let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
1832
1905
  let ringColorDefault = withAlphaValue(
1833
1906
  theme('ringColor.DEFAULT'),
@@ -1835,16 +1908,15 @@ export let corePlugins = {
1835
1908
  `rgb(147 197 253 / ${ringOpacityDefault})`
1836
1909
  )
1837
1910
 
1838
- addBase({
1839
- '@defaults ring-width': {
1840
- '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
1841
- '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
1842
- '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
1843
- '--tw-ring-color': ringColorDefault,
1844
- '--tw-ring-offset-shadow': '0 0 #0000',
1845
- '--tw-ring-shadow': '0 0 #0000',
1846
- '--tw-shadow': '0 0 #0000',
1847
- },
1911
+ addDefaults('ring-width', {
1912
+ '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
1913
+ '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
1914
+ '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
1915
+ '--tw-ring-color': ringColorDefault,
1916
+ '--tw-ring-offset-shadow': '0 0 #0000',
1917
+ '--tw-ring-shadow': '0 0 #0000',
1918
+ '--tw-shadow': '0 0 #0000',
1919
+ '--tw-shadow-colored': '0 0 #0000',
1848
1920
  })
1849
1921
 
1850
1922
  matchUtilities(
@@ -2051,30 +2123,28 @@ export let corePlugins = {
2051
2123
  )
2052
2124
  },
2053
2125
 
2054
- filter: ({ addBase, addUtilities }) => {
2055
- addBase({
2056
- '@defaults filter': {
2057
- '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2058
- '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2059
- '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2060
- '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2061
- '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2062
- '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2063
- '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2064
- '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2065
- '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)',
2066
- '--tw-filter': [
2067
- 'var(--tw-blur)',
2068
- 'var(--tw-brightness)',
2069
- 'var(--tw-contrast)',
2070
- 'var(--tw-grayscale)',
2071
- 'var(--tw-hue-rotate)',
2072
- 'var(--tw-invert)',
2073
- 'var(--tw-saturate)',
2074
- 'var(--tw-sepia)',
2075
- 'var(--tw-drop-shadow)',
2076
- ].join(' '),
2077
- },
2126
+ filter: ({ addDefaults, addUtilities }) => {
2127
+ addDefaults('filter', {
2128
+ '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2129
+ '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2130
+ '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2131
+ '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2132
+ '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2133
+ '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2134
+ '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2135
+ '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2136
+ '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)',
2137
+ '--tw-filter': [
2138
+ 'var(--tw-blur)',
2139
+ 'var(--tw-brightness)',
2140
+ 'var(--tw-contrast)',
2141
+ 'var(--tw-grayscale)',
2142
+ 'var(--tw-hue-rotate)',
2143
+ 'var(--tw-invert)',
2144
+ 'var(--tw-saturate)',
2145
+ 'var(--tw-sepia)',
2146
+ 'var(--tw-drop-shadow)',
2147
+ ].join(' '),
2078
2148
  })
2079
2149
  addUtilities({
2080
2150
  '.filter': { '@defaults filter': {}, filter: 'var(--tw-filter)' },
@@ -2217,30 +2287,28 @@ export let corePlugins = {
2217
2287
  )
2218
2288
  },
2219
2289
 
2220
- backdropFilter: ({ addBase, addUtilities }) => {
2221
- addBase({
2222
- '@defaults backdrop-filter': {
2223
- '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2224
- '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2225
- '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2226
- '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2227
- '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2228
- '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2229
- '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)',
2230
- '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2231
- '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2232
- '--tw-backdrop-filter': [
2233
- 'var(--tw-backdrop-blur)',
2234
- 'var(--tw-backdrop-brightness)',
2235
- 'var(--tw-backdrop-contrast)',
2236
- 'var(--tw-backdrop-grayscale)',
2237
- 'var(--tw-backdrop-hue-rotate)',
2238
- 'var(--tw-backdrop-invert)',
2239
- 'var(--tw-backdrop-opacity)',
2240
- 'var(--tw-backdrop-saturate)',
2241
- 'var(--tw-backdrop-sepia)',
2242
- ].join(' '),
2243
- },
2290
+ backdropFilter: ({ addDefaults, addUtilities }) => {
2291
+ addDefaults('backdrop-filter', {
2292
+ '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2293
+ '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2294
+ '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2295
+ '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2296
+ '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2297
+ '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2298
+ '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)',
2299
+ '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2300
+ '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2301
+ '--tw-backdrop-filter': [
2302
+ 'var(--tw-backdrop-blur)',
2303
+ 'var(--tw-backdrop-brightness)',
2304
+ 'var(--tw-backdrop-contrast)',
2305
+ 'var(--tw-backdrop-grayscale)',
2306
+ 'var(--tw-backdrop-hue-rotate)',
2307
+ 'var(--tw-backdrop-invert)',
2308
+ 'var(--tw-backdrop-opacity)',
2309
+ 'var(--tw-backdrop-saturate)',
2310
+ 'var(--tw-backdrop-sepia)',
2311
+ ].join(' '),
2244
2312
  })
2245
2313
  addUtilities({
2246
2314
  '.backdrop-filter': {
@@ -144,7 +144,7 @@ sup {
144
144
  table {
145
145
  text-indent: 0; /* 1 */
146
146
  border-color: inherit; /* 2 */
147
- border-collapse: collapse; /* 3 */
147
+ border-collapse: collapse; /* 3 */
148
148
  }
149
149
 
150
150
  /*
@@ -288,7 +288,8 @@ legend {
288
288
  }
289
289
 
290
290
  ol,
291
- ul {
291
+ ul,
292
+ menu {
292
293
  list-style: none;
293
294
  margin: 0;
294
295
  padding: 0;
@@ -309,7 +310,7 @@ textarea {
309
310
 
310
311
  input::placeholder,
311
312
  textarea::placeholder {
312
- opacity: 1; /* 1 */
313
+ opacity: 1; /* 1 */
313
314
  color: theme('colors.gray.400', #9ca3af); /* 2 */
314
315
  }
315
316
 
@@ -2,7 +2,11 @@ import chalk from 'chalk'
2
2
  import log from './util/log'
3
3
 
4
4
  let defaults = {
5
- optimizeUniversalDefaults: true,
5
+ // TODO: Drop this once we can safely rely on optimizeUniversalDefaults being
6
+ // the default.
7
+ optimizeUniversalDefaults: process.env.NODE_ENV === 'test' ? true : false,
8
+
9
+ // optimizeUniversalDefaults: true
6
10
  }
7
11
 
8
12
  let featureFlags = {