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.
Files changed (120) hide show
  1. package/CHANGELOG.md +106 -1
  2. package/README.md +1 -1
  3. package/colors.js +1 -304
  4. package/defaultConfig.js +1 -4
  5. package/defaultTheme.js +1 -4
  6. package/lib/cli-peer-dependencies.js +4 -9
  7. package/lib/cli.js +646 -705
  8. package/lib/constants.js +15 -15
  9. package/lib/corePluginList.js +174 -4
  10. package/lib/corePlugins.js +3637 -2934
  11. package/lib/css/preflight.css +14 -1
  12. package/lib/featureFlags.js +44 -44
  13. package/lib/index.js +25 -24
  14. package/lib/lib/collapseAdjacentRules.js +33 -35
  15. package/lib/lib/collapseDuplicateDeclarations.js +29 -0
  16. package/lib/lib/detectNesting.js +34 -0
  17. package/lib/lib/evaluateTailwindFunctions.js +134 -155
  18. package/lib/lib/expandApplyAtRules.js +183 -200
  19. package/lib/lib/expandTailwindAtRules.js +219 -232
  20. package/lib/lib/generateRules.js +478 -311
  21. package/lib/lib/getModuleDependencies.js +36 -41
  22. package/lib/lib/normalizeTailwindDirectives.js +66 -58
  23. package/lib/lib/resolveDefaultsAtRules.js +110 -90
  24. package/lib/lib/setupContextUtils.js +740 -580
  25. package/lib/lib/setupTrackingContext.js +142 -162
  26. package/lib/lib/setupWatchingContext.js +235 -278
  27. package/lib/lib/sharedState.js +7 -17
  28. package/lib/lib/substituteScreenAtRules.js +22 -26
  29. package/lib/processTailwindFeatures.js +38 -44
  30. package/lib/public/colors.js +329 -0
  31. package/lib/public/create-plugin.js +13 -0
  32. package/lib/public/default-config.js +14 -0
  33. package/lib/public/default-theme.js +14 -0
  34. package/lib/public/resolve-config.js +19 -0
  35. package/lib/util/bigSign.js +3 -5
  36. package/lib/util/buildMediaQuery.js +15 -31
  37. package/lib/util/cloneDeep.js +14 -13
  38. package/lib/util/cloneNodes.js +9 -13
  39. package/lib/util/color.js +69 -59
  40. package/lib/util/configurePlugins.js +13 -14
  41. package/lib/util/createPlugin.js +21 -24
  42. package/lib/util/createUtilityPlugin.js +47 -45
  43. package/lib/util/dataTypes.js +231 -0
  44. package/lib/util/defaults.js +10 -14
  45. package/lib/util/escapeClassName.js +12 -14
  46. package/lib/util/escapeCommas.js +3 -5
  47. package/lib/util/flattenColorPalette.js +14 -10
  48. package/lib/util/formatVariantSelector.js +186 -0
  49. package/lib/util/getAllConfigs.js +23 -16
  50. package/lib/util/hashConfig.js +10 -10
  51. package/lib/util/isKeyframeRule.js +3 -5
  52. package/lib/util/isPlainObject.js +7 -10
  53. package/lib/util/isValidArbitraryValue.js +64 -0
  54. package/lib/util/log.js +39 -30
  55. package/lib/util/nameClass.js +23 -23
  56. package/lib/util/negateValue.js +14 -15
  57. package/lib/util/normalizeConfig.js +208 -0
  58. package/lib/util/normalizeScreens.js +58 -0
  59. package/lib/util/parseAnimationValue.js +82 -53
  60. package/lib/util/parseBoxShadowValue.js +77 -0
  61. package/lib/util/parseDependency.js +49 -60
  62. package/lib/util/parseObjectStyles.js +23 -20
  63. package/lib/util/pluginUtils.js +153 -285
  64. package/lib/util/prefixSelector.js +14 -16
  65. package/lib/util/resolveConfig.js +194 -249
  66. package/lib/util/resolveConfigPath.js +38 -45
  67. package/lib/util/responsive.js +12 -11
  68. package/lib/util/tap.js +4 -6
  69. package/lib/util/toColorValue.js +4 -5
  70. package/lib/util/toPath.js +4 -6
  71. package/lib/util/transformThemeValue.js +57 -26
  72. package/lib/util/withAlphaVariable.js +56 -54
  73. package/package.json +27 -37
  74. package/peers/index.js +73099 -84294
  75. package/plugin.js +1 -3
  76. package/resolveConfig.js +1 -7
  77. package/scripts/create-plugin-list.js +2 -2
  78. package/src/cli.js +27 -18
  79. package/src/corePluginList.js +1 -1
  80. package/src/corePlugins.js +2124 -1968
  81. package/src/css/preflight.css +14 -1
  82. package/src/featureFlags.js +12 -6
  83. package/src/lib/collapseDuplicateDeclarations.js +28 -0
  84. package/src/lib/detectNesting.js +39 -0
  85. package/src/lib/evaluateTailwindFunctions.js +5 -2
  86. package/src/lib/expandTailwindAtRules.js +24 -32
  87. package/src/lib/generateRules.js +230 -20
  88. package/src/lib/normalizeTailwindDirectives.js +3 -2
  89. package/src/lib/resolveDefaultsAtRules.js +46 -30
  90. package/src/lib/setupContextUtils.js +275 -113
  91. package/src/lib/setupTrackingContext.js +9 -8
  92. package/src/lib/setupWatchingContext.js +12 -7
  93. package/src/lib/sharedState.js +1 -4
  94. package/src/lib/substituteScreenAtRules.js +6 -3
  95. package/src/processTailwindFeatures.js +8 -1
  96. package/src/public/colors.js +300 -0
  97. package/src/public/create-plugin.js +2 -0
  98. package/src/public/default-config.js +4 -0
  99. package/src/public/default-theme.js +4 -0
  100. package/src/public/resolve-config.js +7 -0
  101. package/src/util/buildMediaQuery.js +14 -18
  102. package/src/util/createUtilityPlugin.js +2 -11
  103. package/src/util/dataTypes.js +246 -0
  104. package/src/util/formatVariantSelector.js +196 -0
  105. package/src/util/isValidArbitraryValue.js +61 -0
  106. package/src/util/log.js +18 -21
  107. package/src/util/nameClass.js +10 -6
  108. package/src/util/negateValue.js +4 -2
  109. package/src/util/normalizeConfig.js +249 -0
  110. package/src/util/normalizeScreens.js +42 -0
  111. package/src/util/parseAnimationValue.js +7 -1
  112. package/src/util/parseBoxShadowValue.js +71 -0
  113. package/src/util/parseDependency.js +4 -0
  114. package/src/util/pluginUtils.js +101 -204
  115. package/src/util/prefixSelector.js +1 -4
  116. package/src/util/resolveConfig.js +12 -65
  117. package/src/util/transformThemeValue.js +22 -7
  118. package/src/util/withAlphaVariable.js +13 -8
  119. package/stubs/defaultConfig.stub.js +163 -97
  120. package/stubs/simpleConfig.stub.js +0 -1
package/plugin.js CHANGED
@@ -1,3 +1 @@
1
- const createPlugin = require('./lib/util/createPlugin')
2
-
3
- module.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default
1
+ module.exports = require('./lib/public/create-plugin').default
package/resolveConfig.js CHANGED
@@ -1,7 +1 @@
1
- const resolveConfigObjects = require('./lib/util/resolveConfig').default
2
- const getAllConfigs = require('./lib/util/getAllConfigs').default
3
-
4
- module.exports = function resolveConfig(...configs) {
5
- const [, ...defaultConfigs] = getAllConfigs(configs[0])
6
- return resolveConfigObjects([...configs, ...defaultConfigs])
7
- }
1
+ module.exports = require('./lib/public/resolve-config').default
@@ -1,8 +1,8 @@
1
- import * as corePlugins from '../src/corePlugins'
1
+ import { corePlugins } from '../src/corePlugins'
2
2
  import fs from 'fs'
3
3
  import path from 'path'
4
4
 
5
- let corePluginList = Object.keys(corePlugins).filter((plugin) => !plugin.includes('Variants'))
5
+ let corePluginList = Object.keys(corePlugins)
6
6
 
7
7
  fs.writeFileSync(
8
8
  path.join(process.cwd(), 'src', 'corePluginList.js'),
package/src/cli.js CHANGED
@@ -15,9 +15,10 @@ import fastGlob from 'fast-glob'
15
15
  import getModuleDependencies from './lib/getModuleDependencies'
16
16
  import log from './util/log'
17
17
  import packageJson from '../package.json'
18
+ import normalizePath from 'normalize-path'
18
19
 
19
20
  let env = {
20
- DEBUG: process.env.DEBUG !== undefined,
21
+ DEBUG: process.env.DEBUG !== undefined && process.env.DEBUG !== '0',
21
22
  }
22
23
 
23
24
  // ---
@@ -419,34 +420,35 @@ async function build() {
419
420
  let resolvedConfig = resolveConfigInternal(config)
420
421
 
421
422
  if (args['--purge']) {
422
- log.warn(['The `--purge` flag has been deprecated.', 'Please use `--content` instead.'])
423
+ log.warn('purge-flag-deprecated', [
424
+ 'The `--purge` flag has been deprecated.',
425
+ 'Please use `--content` instead.',
426
+ ])
423
427
  if (!args['--content']) {
424
- args['--content'] = ['--purge']
428
+ args['--content'] = args['--purge']
425
429
  }
426
430
  }
427
431
 
428
432
  if (args['--content']) {
429
- resolvedConfig.content = args['--content'].split(/(?<!{[^}]+),/)
433
+ resolvedConfig.content.files = args['--content'].split(/(?<!{[^}]+),/)
430
434
  }
431
435
 
432
436
  return resolvedConfig
433
437
  }
434
438
 
435
- function extractContent(config) {
436
- return config.content.content.concat(config.content.safelist)
437
- }
438
-
439
439
  function extractFileGlobs(config) {
440
- return extractContent(config).filter((file) => {
441
- // Strings in this case are files / globs. If it is something else,
442
- // like an object it's probably a raw content object. But this object
443
- // is not watchable, so let's remove it.
444
- return typeof file === 'string'
445
- })
440
+ return config.content.files
441
+ .filter((file) => {
442
+ // Strings in this case are files / globs. If it is something else,
443
+ // like an object it's probably a raw content object. But this object
444
+ // is not watchable, so let's remove it.
445
+ return typeof file === 'string'
446
+ })
447
+ .map((glob) => normalizePath(glob))
446
448
  }
447
449
 
448
450
  function extractRawContent(config) {
449
- return extractContent(config).filter((file) => {
451
+ return config.content.files.filter((file) => {
450
452
  return typeof file === 'object' && file !== null
451
453
  })
452
454
  }
@@ -461,7 +463,7 @@ async function build() {
461
463
  for (let file of files) {
462
464
  changedContent.push({
463
465
  content: fs.readFileSync(path.resolve(file), 'utf8'),
464
- extension: path.extname(file),
466
+ extension: path.extname(file).slice(1),
465
467
  })
466
468
  }
467
469
 
@@ -698,6 +700,13 @@ async function build() {
698
700
 
699
701
  watcher = chokidar.watch([...contextDependencies, ...extractFileGlobs(config)], {
700
702
  ignoreInitial: true,
703
+ awaitWriteFinish:
704
+ process.platform === 'win32'
705
+ ? {
706
+ stabilityThreshold: 50,
707
+ pollInterval: 10,
708
+ }
709
+ : false,
701
710
  })
702
711
 
703
712
  let chain = Promise.resolve()
@@ -723,7 +732,7 @@ async function build() {
723
732
  chain = chain.then(async () => {
724
733
  changedContent.push({
725
734
  content: fs.readFileSync(path.resolve(file), 'utf8'),
726
- extension: path.extname(file),
735
+ extension: path.extname(file).slice(1),
727
736
  })
728
737
 
729
738
  await rebuild(config)
@@ -735,7 +744,7 @@ async function build() {
735
744
  chain = chain.then(async () => {
736
745
  changedContent.push({
737
746
  content: fs.readFileSync(path.resolve(file), 'utf8'),
738
- extension: path.extname(file),
747
+ extension: path.extname(file).slice(1),
739
748
  })
740
749
 
741
750
  await rebuild(config)
@@ -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","tableLayout","borderCollapse","transformOrigin","translate","rotate","skew","scale","transform","animation","cursor","userSelect","resize","listStylePosition","listStyleType","appearance","columns","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","fontSmoothing","placeholderColor","placeholderOpacity","caretColor","accentColor","opacity","backgroundBlendMode","mixBlendMode","boxShadow","outline","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"]