tailwindcss 0.0.0-insiders.8259dfd → 0.0.0-insiders.8293c2d
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 +207 -2
- package/README.md +8 -4
- package/colors.js +2 -1
- package/defaultConfig.js +2 -1
- package/defaultTheme.js +2 -1
- package/lib/cli.js +94 -61
- package/lib/constants.js +1 -1
- package/lib/corePluginList.js +8 -1
- package/lib/corePlugins.js +477 -517
- package/lib/css/preflight.css +18 -5
- package/lib/featureFlags.js +5 -6
- package/lib/index.js +1 -3
- package/lib/lib/collapseDuplicateDeclarations.js +80 -0
- package/lib/lib/defaultExtractor.js +42 -0
- package/lib/lib/detectNesting.js +17 -2
- package/lib/lib/evaluateTailwindFunctions.js +10 -6
- package/lib/lib/expandApplyAtRules.js +94 -45
- package/lib/lib/expandTailwindAtRules.js +32 -33
- package/lib/lib/generateRules.js +167 -21
- package/lib/lib/normalizeTailwindDirectives.js +8 -1
- package/lib/lib/partitionApplyAtRules.js +53 -0
- package/lib/lib/resolveDefaultsAtRules.js +28 -14
- package/lib/lib/setupContextUtils.js +153 -129
- package/lib/lib/setupTrackingContext.js +11 -10
- package/lib/lib/sharedState.js +34 -5
- package/lib/lib/substituteScreenAtRules.js +7 -4
- package/lib/processTailwindFeatures.js +7 -2
- package/lib/util/buildMediaQuery.js +13 -24
- package/lib/util/color.js +23 -8
- package/lib/util/createPlugin.js +1 -2
- package/lib/util/createUtilityPlugin.js +6 -10
- package/lib/util/dataTypes.js +38 -7
- package/lib/util/defaults.js +6 -0
- package/lib/util/flattenColorPalette.js +1 -3
- package/lib/util/formatVariantSelector.js +186 -0
- package/lib/util/isValidArbitraryValue.js +64 -0
- package/lib/util/log.js +4 -0
- package/lib/util/nameClass.js +1 -0
- package/lib/util/normalizeConfig.js +63 -21
- package/lib/util/normalizeScreens.js +59 -0
- package/lib/util/parseBoxShadowValue.js +77 -0
- package/lib/util/pluginUtils.js +27 -158
- package/lib/util/prefixSelector.js +1 -3
- package/lib/util/resolveConfig.js +30 -31
- package/lib/util/resolveConfigPath.js +1 -2
- package/lib/util/toColorValue.js +1 -2
- package/lib/util/toPath.js +6 -1
- package/lib/util/transformThemeValue.js +19 -13
- package/nesting/plugin.js +4 -1
- package/package.json +19 -21
- package/peers/index.js +4621 -5626
- package/plugin.js +2 -1
- package/resolveConfig.js +2 -1
- package/src/cli.js +66 -14
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +406 -518
- package/src/css/preflight.css +18 -5
- package/src/featureFlags.js +1 -1
- package/src/index.js +1 -7
- package/src/lib/collapseDuplicateDeclarations.js +93 -0
- package/src/lib/defaultExtractor.js +48 -0
- package/src/lib/detectNesting.js +22 -3
- package/src/lib/evaluateTailwindFunctions.js +6 -3
- package/src/lib/expandApplyAtRules.js +101 -45
- package/src/lib/expandTailwindAtRules.js +33 -27
- package/src/lib/generateRules.js +178 -11
- package/src/lib/normalizeTailwindDirectives.js +6 -1
- package/src/lib/partitionApplyAtRules.js +52 -0
- package/src/lib/resolveDefaultsAtRules.js +31 -10
- package/src/lib/setupContextUtils.js +140 -84
- package/src/lib/setupTrackingContext.js +11 -10
- package/src/lib/sharedState.js +40 -4
- package/src/lib/substituteScreenAtRules.js +6 -3
- package/src/processTailwindFeatures.js +8 -2
- package/src/util/buildMediaQuery.js +14 -18
- package/src/util/color.js +20 -7
- package/src/util/dataTypes.js +43 -11
- package/src/util/defaults.js +6 -0
- package/src/util/formatVariantSelector.js +196 -0
- package/src/util/isValidArbitraryValue.js +61 -0
- package/src/util/log.js +4 -0
- package/src/util/nameClass.js +1 -1
- package/src/util/normalizeConfig.js +37 -2
- package/src/util/normalizeScreens.js +45 -0
- package/src/util/parseBoxShadowValue.js +71 -0
- package/src/util/pluginUtils.js +15 -138
- package/src/util/prefixSelector.js +1 -4
- package/src/util/resolveConfig.js +11 -1
- package/src/util/toPath.js +23 -1
- package/src/util/transformThemeValue.js +22 -7
- package/stubs/defaultConfig.stub.js +42 -16
- package/lib/lib/setupWatchingContext.js +0 -284
- package/src/lib/setupWatchingContext.js +0 -304
package/plugin.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
1
|
+
let resolveConfig = require('./lib/public/resolve-config')
|
|
2
|
+
module.exports = (resolveConfig.__esModule ? resolveConfig : { default: resolveConfig }).default
|
package/src/cli.js
CHANGED
|
@@ -18,7 +18,7 @@ import packageJson from '../package.json'
|
|
|
18
18
|
import normalizePath from 'normalize-path'
|
|
19
19
|
|
|
20
20
|
let env = {
|
|
21
|
-
DEBUG: process.env.DEBUG !== undefined,
|
|
21
|
+
DEBUG: process.env.DEBUG !== undefined && process.env.DEBUG !== '0',
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// ---
|
|
@@ -41,6 +41,26 @@ function formatNodes(root) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
async function outputFile(file, contents) {
|
|
45
|
+
if (fs.existsSync(file) && (await fs.promises.readFile(file, 'utf8')) === contents) {
|
|
46
|
+
return // Skip writing the file
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Write the file
|
|
50
|
+
await fs.promises.writeFile(file, contents, 'utf8')
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function drainStdin() {
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
let result = ''
|
|
56
|
+
process.stdin.on('data', (chunk) => {
|
|
57
|
+
result += chunk
|
|
58
|
+
})
|
|
59
|
+
process.stdin.on('end', () => resolve(result))
|
|
60
|
+
process.stdin.on('error', (err) => reject(err))
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
44
64
|
function help({ message, usage, commands, options }) {
|
|
45
65
|
let indent = 2
|
|
46
66
|
|
|
@@ -355,7 +375,7 @@ async function build() {
|
|
|
355
375
|
input = args['--input'] = args['_'][1]
|
|
356
376
|
}
|
|
357
377
|
|
|
358
|
-
if (input && !fs.existsSync((input = path.resolve(input)))) {
|
|
378
|
+
if (input && input !== '-' && !fs.existsSync((input = path.resolve(input)))) {
|
|
359
379
|
console.error(`Specified input file ${args['--input']} does not exist.`)
|
|
360
380
|
process.exit(9)
|
|
361
381
|
}
|
|
@@ -430,7 +450,7 @@ async function build() {
|
|
|
430
450
|
}
|
|
431
451
|
|
|
432
452
|
if (args['--content']) {
|
|
433
|
-
resolvedConfig.content = args['--content'].split(/(?<!{[^}]+),/)
|
|
453
|
+
resolvedConfig.content.files = args['--content'].split(/(?<!{[^}]+),/)
|
|
434
454
|
}
|
|
435
455
|
|
|
436
456
|
return resolvedConfig
|
|
@@ -534,10 +554,11 @@ async function build() {
|
|
|
534
554
|
if (!output) {
|
|
535
555
|
return process.stdout.write(result.css)
|
|
536
556
|
}
|
|
557
|
+
|
|
537
558
|
return Promise.all(
|
|
538
559
|
[
|
|
539
|
-
|
|
540
|
-
result.map &&
|
|
560
|
+
outputFile(output, result.css),
|
|
561
|
+
result.map && outputFile(output + '.map', result.map.toString()),
|
|
541
562
|
].filter(Boolean)
|
|
542
563
|
)
|
|
543
564
|
})
|
|
@@ -548,9 +569,21 @@ async function build() {
|
|
|
548
569
|
})
|
|
549
570
|
}
|
|
550
571
|
|
|
551
|
-
let css =
|
|
552
|
-
|
|
553
|
-
|
|
572
|
+
let css = await (() => {
|
|
573
|
+
// Piping in data, let's drain the stdin
|
|
574
|
+
if (input === '-') {
|
|
575
|
+
return drainStdin()
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// Input file has been provided
|
|
579
|
+
if (input) {
|
|
580
|
+
return fs.readFileSync(path.resolve(input), 'utf8')
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
// No input file provided, fallback to default atrules
|
|
584
|
+
return '@tailwind base; @tailwind components; @tailwind utilities'
|
|
585
|
+
})()
|
|
586
|
+
|
|
554
587
|
return processCSS(css)
|
|
555
588
|
}
|
|
556
589
|
|
|
@@ -664,10 +697,10 @@ async function build() {
|
|
|
664
697
|
return process.stdout.write(result.css)
|
|
665
698
|
}
|
|
666
699
|
|
|
667
|
-
|
|
700
|
+
return Promise.all(
|
|
668
701
|
[
|
|
669
|
-
|
|
670
|
-
result.map &&
|
|
702
|
+
outputFile(output, result.css),
|
|
703
|
+
result.map && outputFile(output + '.map', result.map.toString()),
|
|
671
704
|
].filter(Boolean)
|
|
672
705
|
)
|
|
673
706
|
})
|
|
@@ -684,9 +717,21 @@ async function build() {
|
|
|
684
717
|
})
|
|
685
718
|
}
|
|
686
719
|
|
|
687
|
-
let css =
|
|
688
|
-
|
|
689
|
-
|
|
720
|
+
let css = await (() => {
|
|
721
|
+
// Piping in data, let's drain the stdin
|
|
722
|
+
if (input === '-') {
|
|
723
|
+
return drainStdin()
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// Input file has been provided
|
|
727
|
+
if (input) {
|
|
728
|
+
return fs.readFileSync(path.resolve(input), 'utf8')
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
// No input file provided, fallback to default atrules
|
|
732
|
+
return '@tailwind base; @tailwind components; @tailwind utilities'
|
|
733
|
+
})()
|
|
734
|
+
|
|
690
735
|
let result = await processCSS(css)
|
|
691
736
|
env.DEBUG && console.timeEnd('Finished in')
|
|
692
737
|
return result
|
|
@@ -700,6 +745,13 @@ async function build() {
|
|
|
700
745
|
|
|
701
746
|
watcher = chokidar.watch([...contextDependencies, ...extractFileGlobs(config)], {
|
|
702
747
|
ignoreInitial: true,
|
|
748
|
+
awaitWriteFinish:
|
|
749
|
+
process.platform === 'win32'
|
|
750
|
+
? {
|
|
751
|
+
stabilityThreshold: 50,
|
|
752
|
+
pollInterval: 10,
|
|
753
|
+
}
|
|
754
|
+
: false,
|
|
703
755
|
})
|
|
704
756
|
|
|
705
757
|
let chain = Promise.resolve()
|
package/src/corePluginList.js
CHANGED
|
@@ -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","
|
|
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"]
|