tailwindcss 0.0.0-oxide-insiders.a7fe2fe → 0.0.0-oxide-insiders.7f555c4

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 (108) hide show
  1. package/lib/cli/build/deps.js +34 -18
  2. package/lib/cli/build/index.js +45 -12
  3. package/lib/cli/build/plugin.js +273 -90
  4. package/lib/cli/build/utils.js +56 -24
  5. package/lib/cli/build/watching.js +156 -38
  6. package/lib/cli/help/index.js +61 -16
  7. package/lib/cli/index.js +121 -62
  8. package/lib/cli/init/index.js +47 -23
  9. package/lib/cli-peer-dependencies.js +23 -13
  10. package/lib/cli.js +5 -1
  11. package/lib/corePluginList.js +7 -4
  12. package/lib/corePlugins.js +855 -386
  13. package/lib/featureFlags.js +43 -18
  14. package/lib/lib/cacheInvalidation.js +78 -30
  15. package/lib/lib/collapseAdjacentRules.js +46 -23
  16. package/lib/lib/collapseDuplicateDeclarations.js +70 -27
  17. package/lib/lib/content.js +134 -41
  18. package/lib/lib/defaultExtractor.js +201 -96
  19. package/lib/lib/detectNesting.js +38 -12
  20. package/lib/lib/evaluateTailwindFunctions.js +192 -103
  21. package/lib/lib/expandApplyAtRules.js +488 -181
  22. package/lib/lib/expandTailwindAtRules.js +240 -70
  23. package/lib/lib/findAtConfigPath.js +34 -15
  24. package/lib/lib/generateRules.js +775 -353
  25. package/lib/lib/getModuleDependencies.js +67 -29
  26. package/lib/lib/load-config.js +27 -17
  27. package/lib/lib/normalizeTailwindDirectives.js +73 -27
  28. package/lib/lib/offsets.js +227 -62
  29. package/lib/lib/partitionApplyAtRules.js +53 -29
  30. package/lib/lib/regex.js +50 -28
  31. package/lib/lib/remap-bitfield.js +86 -9
  32. package/lib/lib/resolveDefaultsAtRules.js +123 -53
  33. package/lib/lib/setupContextUtils.js +1117 -584
  34. package/lib/lib/setupTrackingContext.js +149 -58
  35. package/lib/lib/sharedState.js +71 -23
  36. package/lib/lib/substituteScreenAtRules.js +19 -9
  37. package/lib/oxide/cli/build/deps.js +46 -23
  38. package/lib/oxide/cli/build/index.js +44 -12
  39. package/lib/oxide/cli/build/plugin.js +271 -89
  40. package/lib/oxide/cli/build/utils.js +55 -24
  41. package/lib/oxide/cli/build/watching.js +153 -36
  42. package/lib/oxide/cli/help/index.js +60 -16
  43. package/lib/oxide/cli/index.js +128 -67
  44. package/lib/oxide/cli/init/index.js +40 -19
  45. package/lib/oxide/cli.js +3 -2
  46. package/lib/plugin.js +58 -31
  47. package/lib/postcss-plugins/nesting/index.js +13 -7
  48. package/lib/postcss-plugins/nesting/plugin.js +65 -20
  49. package/lib/processTailwindFeatures.js +41 -10
  50. package/lib/public/colors.js +25 -16
  51. package/lib/public/create-plugin.js +11 -6
  52. package/lib/public/default-config.js +12 -6
  53. package/lib/public/default-theme.js +12 -6
  54. package/lib/public/load-config.js +9 -5
  55. package/lib/public/resolve-config.js +10 -6
  56. package/lib/util/applyImportantSelector.js +28 -17
  57. package/lib/util/bigSign.js +9 -6
  58. package/lib/util/buildMediaQuery.js +19 -10
  59. package/lib/util/cloneDeep.js +19 -9
  60. package/lib/util/cloneNodes.js +29 -14
  61. package/lib/util/color.js +87 -47
  62. package/lib/util/colorNames.js +752 -0
  63. package/lib/util/configurePlugins.js +18 -9
  64. package/lib/util/createPlugin.js +17 -8
  65. package/lib/util/createUtilityPlugin.js +30 -16
  66. package/lib/util/dataTypes.js +189 -38
  67. package/lib/util/defaults.js +21 -9
  68. package/lib/util/escapeClassName.js +15 -9
  69. package/lib/util/escapeCommas.js +9 -6
  70. package/lib/util/flattenColorPalette.js +11 -7
  71. package/lib/util/formatVariantSelector.js +209 -60
  72. package/lib/util/getAllConfigs.js +44 -35
  73. package/lib/util/hashConfig.js +12 -8
  74. package/lib/util/isKeyframeRule.js +10 -7
  75. package/lib/util/isPlainObject.js +14 -9
  76. package/lib/util/isSyntacticallyValidPropertyValue.js +45 -14
  77. package/lib/util/log.js +20 -9
  78. package/lib/util/nameClass.js +31 -10
  79. package/lib/util/negateValue.js +28 -10
  80. package/lib/util/normalizeConfig.js +242 -63
  81. package/lib/util/normalizeScreens.js +145 -70
  82. package/lib/util/parseAnimationValue.js +64 -14
  83. package/lib/util/parseBoxShadowValue.js +63 -14
  84. package/lib/util/parseDependency.js +39 -13
  85. package/lib/util/parseGlob.js +25 -8
  86. package/lib/util/parseObjectStyles.js +29 -18
  87. package/lib/util/pluginUtils.js +196 -77
  88. package/lib/util/prefixSelector.js +31 -12
  89. package/lib/util/pseudoElements.js +116 -34
  90. package/lib/util/removeAlphaVariables.js +23 -8
  91. package/lib/util/resolveConfig.js +224 -105
  92. package/lib/util/resolveConfigPath.js +45 -15
  93. package/lib/util/responsive.js +10 -6
  94. package/lib/util/splitAtTopLevelOnly.js +46 -10
  95. package/lib/util/tap.js +11 -7
  96. package/lib/util/toColorValue.js +10 -7
  97. package/lib/util/toPath.js +28 -8
  98. package/lib/util/transformThemeValue.js +49 -14
  99. package/lib/util/validateConfig.js +25 -15
  100. package/lib/util/validateFormalSyntax.js +14 -6
  101. package/lib/util/withAlphaVariable.js +54 -30
  102. package/package.json +18 -22
  103. package/peers/index.js +57849 -43101
  104. package/src/lib/expandTailwindAtRules.js +1 -1
  105. package/src/lib/setupTrackingContext.js +1 -1
  106. package/src/util/color.js +1 -1
  107. package/src/util/colorNames.js +150 -0
  108. package/src/util/pseudoElements.js +4 -4
@@ -1,25 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
- value: !0
4
- }), Object.defineProperty(exports, "default", {
5
- enumerable: !0,
6
- get: ()=>transformThemeValue
3
+ value: true
7
4
  });
8
- const _postcss = _interopRequireDefault(require("postcss")), _isPlainObject = _interopRequireDefault(require("./isPlainObject"));
9
- function _interopRequireDefault(obj) {
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return transformThemeValue;
9
+ }
10
+ });
11
+ const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
12
+ const _isPlainObject = /*#__PURE__*/ _interop_require_default(require("./isPlainObject"));
13
+ function _interop_require_default(obj) {
10
14
  return obj && obj.__esModule ? obj : {
11
15
  default: obj
12
16
  };
13
17
  }
14
18
  function transformThemeValue(themeSection) {
15
- return [
19
+ if ([
16
20
  "fontSize",
17
21
  "outline"
18
- ].includes(themeSection) ? (value)=>("function" == typeof value && (value = value({})), Array.isArray(value) && (value = value[0]), value) : "fontFamily" === themeSection ? (value)=>{
19
- "function" == typeof value && (value = value({}));
20
- let families = Array.isArray(value) && (0, _isPlainObject.default)(value[1]) ? value[0] : value;
21
- return Array.isArray(families) ? families.join(", ") : families;
22
- } : [
22
+ ].includes(themeSection)) {
23
+ return (value)=>{
24
+ if (typeof value === "function") value = value({});
25
+ if (Array.isArray(value)) value = value[0];
26
+ return value;
27
+ };
28
+ }
29
+ if (themeSection === "fontFamily") {
30
+ return (value)=>{
31
+ if (typeof value === "function") value = value({});
32
+ let families = Array.isArray(value) && (0, _isPlainObject.default)(value[1]) ? value[0] : value;
33
+ return Array.isArray(families) ? families.join(", ") : families;
34
+ };
35
+ }
36
+ if ([
23
37
  "boxShadow",
24
38
  "transitionProperty",
25
39
  "transitionDuration",
@@ -30,9 +44,30 @@ function transformThemeValue(themeSection) {
30
44
  "backgroundColor",
31
45
  "cursor",
32
46
  "animation"
33
- ].includes(themeSection) ? (value)=>("function" == typeof value && (value = value({})), Array.isArray(value) && (value = value.join(", ")), value) : [
47
+ ].includes(themeSection)) {
48
+ return (value)=>{
49
+ if (typeof value === "function") value = value({});
50
+ if (Array.isArray(value)) value = value.join(", ");
51
+ return value;
52
+ };
53
+ }
54
+ // For backwards compatibility reasons, before we switched to underscores
55
+ // instead of commas for arbitrary values.
56
+ if ([
34
57
  "gridTemplateColumns",
35
58
  "gridTemplateRows",
36
59
  "objectPosition"
37
- ].includes(themeSection) ? (value)=>("function" == typeof value && (value = value({})), "string" == typeof value && (value = _postcss.default.list.comma(value).join(" ")), value) : (value, opts = {})=>("function" == typeof value && (value = value(opts)), value);
60
+ ].includes(themeSection)) {
61
+ return (value)=>{
62
+ if (typeof value === "function") value = value({});
63
+ if (typeof value === "string") value = _postcss.default.list.comma(value).join(" ");
64
+ return value;
65
+ };
66
+ }
67
+ return (value, opts = {})=>{
68
+ if (typeof value === "function") {
69
+ value = value(opts);
70
+ }
71
+ return value;
72
+ };
38
73
  }
@@ -1,27 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
- value: !0
4
- }), Object.defineProperty(exports, "validateConfig", {
5
- enumerable: !0,
6
- get: ()=>validateConfig
3
+ value: true
7
4
  });
8
- const _log = function(obj) {
5
+ Object.defineProperty(exports, "validateConfig", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return validateConfig;
9
+ }
10
+ });
11
+ const _log = /*#__PURE__*/ _interop_require_default(require("./log"));
12
+ function _interop_require_default(obj) {
9
13
  return obj && obj.__esModule ? obj : {
10
14
  default: obj
11
15
  };
12
- }(require("./log"));
16
+ }
13
17
  function validateConfig(config) {
14
- 0 === config.content.files.length && _log.default.warn("content-problems", [
15
- "The `content` option in your Tailwind CSS configuration is missing or empty.",
16
- "Configure your content sources or your generated CSS will be missing styles.",
17
- "https://tailwindcss.com/docs/content-configuration"
18
- ]);
18
+ if (config.content.files.length === 0) {
19
+ _log.default.warn("content-problems", [
20
+ "The `content` option in your Tailwind CSS configuration is missing or empty.",
21
+ "Configure your content sources or your generated CSS will be missing styles.",
22
+ "https://tailwindcss.com/docs/content-configuration"
23
+ ]);
24
+ }
25
+ // Warn if the line-clamp plugin is installed
19
26
  try {
20
27
  let plugin = require("@tailwindcss/line-clamp");
21
- config.plugins.includes(plugin) && (_log.default.warn("line-clamp-in-core", [
22
- "As of Tailwind CSS v3.3, the `@tailwindcss/line-clamp` plugin is now included by default.",
23
- "Remove it from the `plugins` array in your configuration to eliminate this warning."
24
- ]), config.plugins = config.plugins.filter((p)=>p !== plugin));
28
+ if (config.plugins.includes(plugin)) {
29
+ _log.default.warn("line-clamp-in-core", [
30
+ "As of Tailwind CSS v3.3, the `@tailwindcss/line-clamp` plugin is now included by default.",
31
+ "Remove it from the `plugins` array in your configuration to eliminate this warning."
32
+ ]);
33
+ config.plugins = config.plugins.filter((p)=>p !== plugin);
34
+ }
25
35
  } catch {}
26
36
  return config;
27
37
  }
@@ -1,18 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
- value: !0
4
- }), Object.defineProperty(exports, "backgroundSize", {
5
- enumerable: !0,
6
- get: ()=>backgroundSize
3
+ value: true
7
4
  });
8
- const _dataTypes = require("./dataTypes"), _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
5
+ Object.defineProperty(exports, "backgroundSize", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return backgroundSize;
9
+ }
10
+ });
11
+ const _dataTypes = require("./dataTypes");
12
+ const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
9
13
  function backgroundSize(value) {
10
14
  let keywordValues = [
11
15
  "cover",
12
16
  "contain"
13
17
  ];
18
+ // the <length-percentage> type will probably be a css function
19
+ // so we have to use `splitAtTopLevelOnly`
14
20
  return (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, ",").every((part)=>{
15
21
  let sizes = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(part, "_").filter(Boolean);
16
- return !!(1 === sizes.length && keywordValues.includes(sizes[0])) || (1 === sizes.length || 2 === sizes.length) && sizes.every((size)=>(0, _dataTypes.length)(size) || (0, _dataTypes.percentage)(size) || "auto" === size);
22
+ if (sizes.length === 1 && keywordValues.includes(sizes[0])) return true;
23
+ if (sizes.length !== 1 && sizes.length !== 2) return false;
24
+ return sizes.every((size)=>(0, _dataTypes.length)(size) || (0, _dataTypes.percentage)(size) || size === "auto");
17
25
  });
18
26
  }
@@ -1,55 +1,79 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
- value: !0
4
- }), function(target, all) {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
5
6
  for(var name in all)Object.defineProperty(target, name, {
6
- enumerable: !0,
7
+ enumerable: true,
7
8
  get: all[name]
8
9
  });
9
- }(exports, {
10
- withAlphaValue: ()=>withAlphaValue,
11
- default: ()=>withAlphaVariable
10
+ }
11
+ _export(exports, {
12
+ withAlphaValue: function() {
13
+ return withAlphaValue;
14
+ },
15
+ default: function() {
16
+ return withAlphaVariable;
17
+ }
12
18
  });
13
19
  const _color = require("./color");
14
20
  function withAlphaValue(color, alphaValue, defaultValue) {
15
- if ("function" == typeof color) return color({
16
- opacityValue: alphaValue
17
- });
21
+ if (typeof color === "function") {
22
+ return color({
23
+ opacityValue: alphaValue
24
+ });
25
+ }
18
26
  let parsed = (0, _color.parseColor)(color, {
19
- loose: !0
27
+ loose: true
20
28
  });
21
- return null === parsed ? defaultValue : (0, _color.formatColor)({
29
+ if (parsed === null) {
30
+ return defaultValue;
31
+ }
32
+ return (0, _color.formatColor)({
22
33
  ...parsed,
23
34
  alpha: alphaValue
24
35
  });
25
36
  }
26
37
  function withAlphaVariable({ color , property , variable }) {
27
38
  let properties = [].concat(property);
28
- if ("function" == typeof color) return {
29
- [variable]: "1",
30
- ...Object.fromEntries(properties.map((p)=>[
39
+ if (typeof color === "function") {
40
+ return {
41
+ [variable]: "1",
42
+ ...Object.fromEntries(properties.map((p)=>{
43
+ return [
44
+ p,
45
+ color({
46
+ opacityVariable: variable,
47
+ opacityValue: `var(${variable})`
48
+ })
49
+ ];
50
+ }))
51
+ };
52
+ }
53
+ const parsed = (0, _color.parseColor)(color);
54
+ if (parsed === null) {
55
+ return Object.fromEntries(properties.map((p)=>[
31
56
  p,
32
- color({
33
- opacityVariable: variable,
34
- opacityValue: `var(${variable})`
35
- })
36
- ]))
37
- };
38
- let parsed = (0, _color.parseColor)(color);
39
- return null === parsed ? Object.fromEntries(properties.map((p)=>[
40
- p,
41
- color
42
- ])) : void 0 !== parsed.alpha ? Object.fromEntries(properties.map((p)=>[
43
- p,
44
- color
45
- ])) : {
57
+ color
58
+ ]));
59
+ }
60
+ if (parsed.alpha !== undefined) {
61
+ // Has an alpha value, return color as-is
62
+ return Object.fromEntries(properties.map((p)=>[
63
+ p,
64
+ color
65
+ ]));
66
+ }
67
+ return {
46
68
  [variable]: "1",
47
- ...Object.fromEntries(properties.map((p)=>[
69
+ ...Object.fromEntries(properties.map((p)=>{
70
+ return [
48
71
  p,
49
72
  (0, _color.formatColor)({
50
73
  ...parsed,
51
74
  alpha: `var(${variable})`
52
75
  })
53
- ]))
76
+ ];
77
+ }))
54
78
  };
55
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "0.0.0-oxide-insiders.a7fe2fe",
3
+ "version": "0.0.0-oxide-insiders.7f555c4",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -48,39 +48,36 @@
48
48
  "*.js"
49
49
  ],
50
50
  "devDependencies": {
51
- "@swc/cli": "0.1.62",
52
- "@swc/core": "1.3.41",
53
- "@swc/jest": "0.2.26",
54
- "@swc/register": "0.1.10",
51
+ "@swc/cli": "^0.1.62",
52
+ "@swc/core": "^1.3.55",
53
+ "@swc/jest": "^0.2.26",
54
+ "@swc/register": "^0.1.10",
55
55
  "autoprefixer": "^10.4.14",
56
- "concurrently": "^7.5.0",
57
- "cssnano": "^5.1.15",
58
- "esbuild": "^0.17.17",
59
- "eslint": "^8.35.0",
56
+ "concurrently": "^8.0.1",
57
+ "cssnano": "^6.0.0",
58
+ "esbuild": "^0.17.18",
59
+ "eslint": "^8.39.0",
60
60
  "eslint-config-prettier": "^8.8.0",
61
61
  "eslint-plugin-prettier": "^4.2.1",
62
62
  "jest": "^29.5.0",
63
63
  "jest-diff": "^29.5.0",
64
- "prettier": "^2.8.7",
65
- "rimraf": "^4.4.0",
64
+ "prettier": "^2.8.8",
65
+ "rimraf": "^5.0.0",
66
66
  "source-map-js": "^1.0.2",
67
- "turbo": "^1.8.3"
68
- },
69
- "peerDependencies": {
70
- "postcss": "^8.0.9"
67
+ "turbo": "^1.9.3"
71
68
  },
72
69
  "dependencies": {
73
- "@tailwindcss/oxide": "0.0.0-oxide-insiders.a7fe2fe",
70
+ "@alloc/quick-lru": "^5.2.0",
71
+ "@tailwindcss/oxide": "0.0.0-oxide-insiders.7f555c4",
74
72
  "arg": "^5.0.2",
75
73
  "browserslist": "^4.21.5",
76
74
  "chokidar": "^3.5.3",
77
- "color-name": "^1.1.4",
78
75
  "didyoumean": "^1.2.2",
79
76
  "dlv": "^1.1.3",
80
77
  "fast-glob": "^3.2.12",
81
78
  "glob-parent": "^6.0.2",
82
79
  "is-glob": "^4.0.3",
83
- "jiti": "^1.17.2",
80
+ "jiti": "^1.18.2",
84
81
  "lightningcss": "^1.18.0",
85
82
  "lilconfig": "^2.1.0",
86
83
  "micromatch": "^4.0.5",
@@ -88,13 +85,12 @@
88
85
  "object-hash": "^3.0.0",
89
86
  "picocolors": "^1.0.0",
90
87
  "postcss": "^8.4.23",
91
- "postcss-import": "^14.1.0",
88
+ "postcss-import": "^15.1.0",
92
89
  "postcss-js": "^4.0.1",
93
- "postcss-load-config": "^3.1.4",
94
- "postcss-nested": "6.0.1",
90
+ "postcss-load-config": "^4.0.1",
91
+ "postcss-nested": "^6.0.1",
95
92
  "postcss-selector-parser": "^6.0.11",
96
93
  "postcss-value-parser": "^4.2.0",
97
- "quick-lru": "^5.1.1",
98
94
  "resolve": "^1.22.3",
99
95
  "sucrase": "^3.32.0"
100
96
  },