tailwindcss 0.0.0-oxide-insiders.9ebaaac → 0.0.0-oxide.2

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 (286) hide show
  1. package/dist/chunk-VA4PAOBV.mjs +5017 -0
  2. package/dist/cli.d.mts +2 -0
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +5446 -0
  5. package/dist/cli.mjs +438 -0
  6. package/dist/lib.d.mts +244 -0
  7. package/dist/lib.d.ts +244 -0
  8. package/dist/lib.js +4947 -0
  9. package/dist/lib.mjs +1 -0
  10. package/index.css +4 -4
  11. package/package.json +36 -106
  12. package/preflight.css +404 -0
  13. package/theme.css +468 -0
  14. package/LICENSE +0 -21
  15. package/README.md +0 -41
  16. package/base.css +0 -1
  17. package/colors.d.ts +0 -3
  18. package/colors.js +0 -2
  19. package/components.css +0 -1
  20. package/defaultConfig.d.ts +0 -3
  21. package/defaultConfig.js +0 -2
  22. package/defaultTheme.d.ts +0 -4
  23. package/defaultTheme.js +0 -2
  24. package/lib/cli/build/deps.js +0 -62
  25. package/lib/cli/build/index.js +0 -54
  26. package/lib/cli/build/plugin.js +0 -383
  27. package/lib/cli/build/utils.js +0 -88
  28. package/lib/cli/build/watching.js +0 -182
  29. package/lib/cli/help/index.js +0 -73
  30. package/lib/cli/index.js +0 -230
  31. package/lib/cli/init/index.js +0 -67
  32. package/lib/cli-peer-dependencies.js +0 -36
  33. package/lib/cli.js +0 -7
  34. package/lib/corePluginList.js +0 -187
  35. package/lib/corePlugins.js +0 -4173
  36. package/lib/css/LICENSE +0 -25
  37. package/lib/css/preflight.css +0 -375
  38. package/lib/featureFlags.js +0 -83
  39. package/lib/index.js +0 -2
  40. package/lib/lib/cacheInvalidation.js +0 -92
  41. package/lib/lib/collapseAdjacentRules.js +0 -61
  42. package/lib/lib/collapseDuplicateDeclarations.js +0 -85
  43. package/lib/lib/content.js +0 -202
  44. package/lib/lib/defaultExtractor.js +0 -243
  45. package/lib/lib/detectNesting.js +0 -45
  46. package/lib/lib/evaluateTailwindFunctions.js +0 -238
  47. package/lib/lib/expandApplyAtRules.js +0 -534
  48. package/lib/lib/expandTailwindAtRules.js +0 -274
  49. package/lib/lib/findAtConfigPath.js +0 -46
  50. package/lib/lib/generateRules.js +0 -882
  51. package/lib/lib/getModuleDependencies.js +0 -99
  52. package/lib/lib/handleImportAtRules.js +0 -49
  53. package/lib/lib/load-config.js +0 -42
  54. package/lib/lib/normalizeTailwindDirectives.js +0 -91
  55. package/lib/lib/offsets.js +0 -306
  56. package/lib/lib/partitionApplyAtRules.js +0 -58
  57. package/lib/lib/regex.js +0 -74
  58. package/lib/lib/remap-bitfield.js +0 -89
  59. package/lib/lib/resolveDefaultsAtRules.js +0 -165
  60. package/lib/lib/setupContextUtils.js +0 -1255
  61. package/lib/lib/setupTrackingContext.js +0 -165
  62. package/lib/lib/sharedState.js +0 -87
  63. package/lib/lib/substituteScreenAtRules.js +0 -31
  64. package/lib/oxide/cli/build/deps.js +0 -89
  65. package/lib/oxide/cli/build/index.js +0 -53
  66. package/lib/oxide/cli/build/plugin.js +0 -354
  67. package/lib/oxide/cli/build/utils.js +0 -87
  68. package/lib/oxide/cli/build/watching.js +0 -179
  69. package/lib/oxide/cli/help/index.js +0 -72
  70. package/lib/oxide/cli/index.js +0 -214
  71. package/lib/oxide/cli/init/index.js +0 -56
  72. package/lib/oxide/cli.js +0 -5
  73. package/lib/oxide/postcss-plugin.js +0 -2
  74. package/lib/plugin.js +0 -100
  75. package/lib/postcss-plugins/nesting/README.md +0 -42
  76. package/lib/postcss-plugins/nesting/index.js +0 -21
  77. package/lib/postcss-plugins/nesting/plugin.js +0 -89
  78. package/lib/processTailwindFeatures.js +0 -64
  79. package/lib/public/colors.js +0 -355
  80. package/lib/public/create-plugin.js +0 -17
  81. package/lib/public/default-config.js +0 -18
  82. package/lib/public/default-theme.js +0 -18
  83. package/lib/public/load-config.js +0 -12
  84. package/lib/public/resolve-config.js +0 -24
  85. package/lib/util/applyImportantSelector.js +0 -36
  86. package/lib/util/bigSign.js +0 -13
  87. package/lib/util/buildMediaQuery.js +0 -27
  88. package/lib/util/cloneDeep.js +0 -22
  89. package/lib/util/cloneNodes.js +0 -34
  90. package/lib/util/color.js +0 -116
  91. package/lib/util/colorNames.js +0 -752
  92. package/lib/util/configurePlugins.js +0 -23
  93. package/lib/util/createPlugin.js +0 -32
  94. package/lib/util/createUtilityPlugin.js +0 -53
  95. package/lib/util/dataTypes.js +0 -304
  96. package/lib/util/defaults.js +0 -27
  97. package/lib/util/escapeClassName.js +0 -24
  98. package/lib/util/escapeCommas.js +0 -13
  99. package/lib/util/flattenColorPalette.js +0 -18
  100. package/lib/util/formatVariantSelector.js +0 -263
  101. package/lib/util/getAllConfigs.js +0 -52
  102. package/lib/util/hashConfig.js +0 -21
  103. package/lib/util/isKeyframeRule.js +0 -13
  104. package/lib/util/isPlainObject.js +0 -17
  105. package/lib/util/isSyntacticallyValidPropertyValue.js +0 -74
  106. package/lib/util/log.js +0 -61
  107. package/lib/util/nameClass.js +0 -49
  108. package/lib/util/negateValue.js +0 -36
  109. package/lib/util/normalizeConfig.js +0 -304
  110. package/lib/util/normalizeScreens.js +0 -178
  111. package/lib/util/parseAnimationValue.js +0 -93
  112. package/lib/util/parseBoxShadowValue.js +0 -88
  113. package/lib/util/parseDependency.js +0 -47
  114. package/lib/util/parseGlob.js +0 -36
  115. package/lib/util/parseObjectStyles.js +0 -36
  116. package/lib/util/pluginUtils.js +0 -276
  117. package/lib/util/prefixSelector.js +0 -39
  118. package/lib/util/pseudoElements.js +0 -229
  119. package/lib/util/removeAlphaVariables.js +0 -31
  120. package/lib/util/resolveConfig.js +0 -256
  121. package/lib/util/resolveConfigPath.js +0 -70
  122. package/lib/util/responsive.js +0 -24
  123. package/lib/util/splitAtTopLevelOnly.js +0 -51
  124. package/lib/util/tap.js +0 -14
  125. package/lib/util/toColorValue.js +0 -13
  126. package/lib/util/toPath.js +0 -32
  127. package/lib/util/transformThemeValue.js +0 -73
  128. package/lib/util/validateConfig.js +0 -43
  129. package/lib/util/validateFormalSyntax.js +0 -26
  130. package/lib/util/withAlphaVariable.js +0 -79
  131. package/lib/value-parser/LICENSE +0 -22
  132. package/lib/value-parser/README.md +0 -3
  133. package/lib/value-parser/index.d.js +0 -2
  134. package/lib/value-parser/index.js +0 -22
  135. package/lib/value-parser/parse.js +0 -259
  136. package/lib/value-parser/stringify.js +0 -38
  137. package/lib/value-parser/unit.js +0 -86
  138. package/lib/value-parser/walk.js +0 -16
  139. package/loadConfig.d.ts +0 -4
  140. package/loadConfig.js +0 -2
  141. package/nesting/index.js +0 -2
  142. package/peers/index.js +0 -96294
  143. package/plugin.d.ts +0 -11
  144. package/plugin.js +0 -2
  145. package/prettier.config.js +0 -19
  146. package/resolveConfig.d.ts +0 -12
  147. package/resolveConfig.js +0 -2
  148. package/screens.css +0 -1
  149. package/scripts/create-plugin-list.js +0 -10
  150. package/scripts/generate-types.js +0 -105
  151. package/scripts/release-channel.js +0 -18
  152. package/scripts/release-notes.js +0 -21
  153. package/scripts/swap-engines.js +0 -40
  154. package/scripts/type-utils.js +0 -27
  155. package/src/cli/build/deps.js +0 -56
  156. package/src/cli/build/index.js +0 -49
  157. package/src/cli/build/plugin.js +0 -451
  158. package/src/cli/build/utils.js +0 -76
  159. package/src/cli/build/watching.js +0 -229
  160. package/src/cli/help/index.js +0 -70
  161. package/src/cli/index.js +0 -216
  162. package/src/cli/init/index.js +0 -84
  163. package/src/cli-peer-dependencies.js +0 -15
  164. package/src/cli.js +0 -7
  165. package/src/corePluginList.js +0 -1
  166. package/src/corePlugins.js +0 -2849
  167. package/src/css/LICENSE +0 -25
  168. package/src/css/preflight.css +0 -375
  169. package/src/featureFlags.js +0 -70
  170. package/src/index.js +0 -1
  171. package/src/lib/cacheInvalidation.js +0 -52
  172. package/src/lib/collapseAdjacentRules.js +0 -58
  173. package/src/lib/collapseDuplicateDeclarations.js +0 -93
  174. package/src/lib/content.js +0 -235
  175. package/src/lib/defaultExtractor.js +0 -217
  176. package/src/lib/detectNesting.js +0 -47
  177. package/src/lib/evaluateTailwindFunctions.js +0 -272
  178. package/src/lib/expandApplyAtRules.js +0 -613
  179. package/src/lib/expandTailwindAtRules.js +0 -283
  180. package/src/lib/findAtConfigPath.js +0 -48
  181. package/src/lib/generateRules.js +0 -927
  182. package/src/lib/getModuleDependencies.js +0 -79
  183. package/src/lib/handleImportAtRules.js +0 -33
  184. package/src/lib/load-config.ts +0 -31
  185. package/src/lib/normalizeTailwindDirectives.js +0 -86
  186. package/src/lib/offsets.js +0 -373
  187. package/src/lib/partitionApplyAtRules.js +0 -52
  188. package/src/lib/regex.js +0 -74
  189. package/src/lib/remap-bitfield.js +0 -82
  190. package/src/lib/resolveDefaultsAtRules.js +0 -163
  191. package/src/lib/setupContextUtils.js +0 -1327
  192. package/src/lib/setupTrackingContext.js +0 -171
  193. package/src/lib/sharedState.js +0 -61
  194. package/src/lib/substituteScreenAtRules.js +0 -19
  195. package/src/oxide/cli/build/deps.ts +0 -91
  196. package/src/oxide/cli/build/index.ts +0 -47
  197. package/src/oxide/cli/build/plugin.ts +0 -419
  198. package/src/oxide/cli/build/utils.ts +0 -74
  199. package/src/oxide/cli/build/watching.ts +0 -225
  200. package/src/oxide/cli/help/index.ts +0 -69
  201. package/src/oxide/cli/index.ts +0 -204
  202. package/src/oxide/cli/init/index.ts +0 -64
  203. package/src/oxide/cli.ts +0 -1
  204. package/src/oxide/postcss-plugin.ts +0 -1
  205. package/src/plugin.js +0 -109
  206. package/src/postcss-plugins/nesting/README.md +0 -42
  207. package/src/postcss-plugins/nesting/index.js +0 -13
  208. package/src/postcss-plugins/nesting/plugin.js +0 -80
  209. package/src/processTailwindFeatures.js +0 -58
  210. package/src/public/colors.js +0 -322
  211. package/src/public/create-plugin.js +0 -2
  212. package/src/public/default-config.js +0 -4
  213. package/src/public/default-theme.js +0 -4
  214. package/src/public/load-config.js +0 -2
  215. package/src/public/resolve-config.js +0 -7
  216. package/src/util/applyImportantSelector.js +0 -27
  217. package/src/util/bigSign.js +0 -3
  218. package/src/util/buildMediaQuery.js +0 -22
  219. package/src/util/cloneDeep.js +0 -11
  220. package/src/util/cloneNodes.js +0 -28
  221. package/src/util/color.js +0 -88
  222. package/src/util/colorNames.js +0 -150
  223. package/src/util/configurePlugins.js +0 -23
  224. package/src/util/createPlugin.js +0 -27
  225. package/src/util/createUtilityPlugin.js +0 -37
  226. package/src/util/dataTypes.js +0 -292
  227. package/src/util/defaults.js +0 -17
  228. package/src/util/escapeClassName.js +0 -8
  229. package/src/util/escapeCommas.js +0 -3
  230. package/src/util/flattenColorPalette.js +0 -13
  231. package/src/util/formatVariantSelector.js +0 -316
  232. package/src/util/getAllConfigs.js +0 -45
  233. package/src/util/hashConfig.js +0 -5
  234. package/src/util/isKeyframeRule.js +0 -3
  235. package/src/util/isPlainObject.js +0 -8
  236. package/src/util/isSyntacticallyValidPropertyValue.js +0 -61
  237. package/src/util/log.js +0 -29
  238. package/src/util/nameClass.js +0 -30
  239. package/src/util/negateValue.js +0 -24
  240. package/src/util/normalizeConfig.js +0 -335
  241. package/src/util/normalizeScreens.js +0 -140
  242. package/src/util/parseAnimationValue.js +0 -68
  243. package/src/util/parseBoxShadowValue.js +0 -72
  244. package/src/util/parseDependency.js +0 -44
  245. package/src/util/parseGlob.js +0 -24
  246. package/src/util/parseObjectStyles.js +0 -19
  247. package/src/util/pluginUtils.js +0 -291
  248. package/src/util/prefixSelector.js +0 -32
  249. package/src/util/pseudoElements.js +0 -170
  250. package/src/util/removeAlphaVariables.js +0 -24
  251. package/src/util/resolveConfig.js +0 -277
  252. package/src/util/resolveConfigPath.js +0 -66
  253. package/src/util/responsive.js +0 -10
  254. package/src/util/splitAtTopLevelOnly.js +0 -52
  255. package/src/util/tap.js +0 -4
  256. package/src/util/toColorValue.js +0 -3
  257. package/src/util/toPath.js +0 -26
  258. package/src/util/transformThemeValue.js +0 -62
  259. package/src/util/validateConfig.js +0 -33
  260. package/src/util/validateFormalSyntax.js +0 -34
  261. package/src/util/withAlphaVariable.js +0 -49
  262. package/src/value-parser/LICENSE +0 -22
  263. package/src/value-parser/README.md +0 -3
  264. package/src/value-parser/index.d.ts +0 -177
  265. package/src/value-parser/index.js +0 -28
  266. package/src/value-parser/parse.js +0 -303
  267. package/src/value-parser/stringify.js +0 -41
  268. package/src/value-parser/unit.js +0 -118
  269. package/src/value-parser/walk.js +0 -18
  270. package/stubs/.gitignore +0 -1
  271. package/stubs/.prettierrc.json +0 -6
  272. package/stubs/config.full.js +0 -991
  273. package/stubs/config.simple.js +0 -7
  274. package/stubs/postcss.config.cjs +0 -6
  275. package/stubs/postcss.config.js +0 -6
  276. package/stubs/tailwind.config.cjs +0 -2
  277. package/stubs/tailwind.config.js +0 -2
  278. package/stubs/tailwind.config.ts +0 -3
  279. package/tailwind.css +0 -5
  280. package/types/config.d.ts +0 -368
  281. package/types/generated/.gitkeep +0 -0
  282. package/types/generated/colors.d.ts +0 -298
  283. package/types/generated/corePluginList.d.ts +0 -1
  284. package/types/generated/default-theme.d.ts +0 -372
  285. package/types/index.d.ts +0 -7
  286. package/variants.css +0 -1
@@ -1,72 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "help", {
6
- enumerable: true,
7
- get: function() {
8
- return help;
9
- }
10
- });
11
- const _packagejson = /*#__PURE__*/ _interop_require_default(require("../../../../package.json"));
12
- function _interop_require_default(obj) {
13
- return obj && obj.__esModule ? obj : {
14
- default: obj
15
- };
16
- }
17
- function help({ message , usage , commands , options }) {
18
- let indent = 2;
19
- // Render header
20
- console.log();
21
- console.log(`${_packagejson.default.name} v${_packagejson.default.version}`);
22
- // Render message
23
- if (message) {
24
- console.log();
25
- for (let msg of message.split("\n")){
26
- console.log(msg);
27
- }
28
- }
29
- // Render usage
30
- if (usage && usage.length > 0) {
31
- console.log();
32
- console.log("Usage:");
33
- for (let example of usage){
34
- console.log(" ".repeat(indent), example);
35
- }
36
- }
37
- // Render commands
38
- if (commands && commands.length > 0) {
39
- console.log();
40
- console.log("Commands:");
41
- for (let command of commands){
42
- console.log(" ".repeat(indent), command);
43
- }
44
- }
45
- // Render options
46
- if (options) {
47
- let groupedOptions = {};
48
- for (let [key, value] of Object.entries(options)){
49
- if (typeof value === "object") {
50
- groupedOptions[key] = {
51
- ...value,
52
- flags: [
53
- key
54
- ]
55
- };
56
- } else {
57
- groupedOptions[value].flags.push(key);
58
- }
59
- }
60
- console.log();
61
- console.log("Options:");
62
- for (let { flags , description , deprecated } of Object.values(groupedOptions)){
63
- if (deprecated) continue;
64
- if (flags.length === 1) {
65
- console.log(" ".repeat(indent + 4 /* 4 = "-i, ".length */ ), flags.slice().reverse().join(", ").padEnd(20, " "), description);
66
- } else {
67
- console.log(" ".repeat(indent), flags.slice().reverse().join(", ").padEnd(24, " "), description);
68
- }
69
- }
70
- }
71
- console.log();
72
- }
@@ -1,214 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- const _path = /*#__PURE__*/ _interop_require_default(require("path"));
7
- const _arg = /*#__PURE__*/ _interop_require_default(require("arg"));
8
- const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
9
- const _build = require("./build");
10
- const _help = require("./help");
11
- const _init = require("./init");
12
- function _interop_require_default(obj) {
13
- return obj && obj.__esModule ? obj : {
14
- default: obj
15
- };
16
- }
17
- // ---
18
- function oneOf(...options) {
19
- return Object.assign((value = true)=>{
20
- for (let option of options){
21
- let parsed = option(value);
22
- if (parsed === value) {
23
- return parsed;
24
- }
25
- }
26
- throw new Error("...");
27
- }, {
28
- manualParsing: true
29
- });
30
- }
31
- let commands = {
32
- init: {
33
- run: _init.init,
34
- args: {
35
- "--esm": {
36
- type: Boolean,
37
- description: `Initialize configuration file as ESM`
38
- },
39
- "--ts": {
40
- type: Boolean,
41
- description: `Initialize configuration file as TypeScript`
42
- },
43
- "--full": {
44
- type: Boolean,
45
- description: `Include the default values for all options in the generated configuration file`
46
- },
47
- "-f": "--full"
48
- }
49
- },
50
- build: {
51
- run: _build.build,
52
- args: {
53
- "--input": {
54
- type: String,
55
- description: "Input file"
56
- },
57
- "--output": {
58
- type: String,
59
- description: "Output file"
60
- },
61
- "--watch": {
62
- type: oneOf(String, Boolean),
63
- description: "Watch for changes and rebuild as needed"
64
- },
65
- "--poll": {
66
- type: Boolean,
67
- description: "Use polling instead of filesystem events when watching"
68
- },
69
- "--content": {
70
- type: String,
71
- description: "Content paths to use for removing unused classes"
72
- },
73
- "--minify": {
74
- type: Boolean,
75
- description: "Minify the output"
76
- },
77
- "--config": {
78
- type: String,
79
- description: "Path to a custom config file"
80
- },
81
- "-c": "--config",
82
- "-i": "--input",
83
- "-o": "--output",
84
- "-m": "--minify",
85
- "-w": "--watch",
86
- "-p": "--poll"
87
- }
88
- }
89
- };
90
- let sharedFlags = {
91
- "--help": {
92
- type: Boolean,
93
- description: "Display usage information"
94
- },
95
- "-h": "--help"
96
- };
97
- if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.argv[2] === undefined || process.argv.slice(2).every((flag)=>sharedFlags[flag] !== undefined))) {
98
- (0, _help.help)({
99
- usage: [
100
- "tailwindcss [--input input.css] [--output output.css] [--watch] [options...]",
101
- "tailwindcss init [--full] [options...]"
102
- ],
103
- commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`),
104
- options: {
105
- ...commands.build.args,
106
- ...sharedFlags
107
- }
108
- });
109
- process.exit(0);
110
- }
111
- let command = ((arg = "")=>arg.startsWith("-") ? undefined : arg)(process.argv[2]) || "build";
112
- if (commands[command] === undefined) {
113
- if (_fs.default.existsSync(_path.default.resolve(command))) {
114
- // TODO: Deprecate this in future versions
115
- // Check if non-existing command, might be a file.
116
- command = "build";
117
- } else {
118
- (0, _help.help)({
119
- message: `Invalid command: ${command}`,
120
- usage: [
121
- "tailwindcss <command> [options]"
122
- ],
123
- commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`),
124
- options: sharedFlags
125
- });
126
- process.exit(1);
127
- }
128
- }
129
- // Execute command
130
- let { args: flags , run } = commands[command];
131
- let args = (()=>{
132
- try {
133
- let result = (0, _arg.default)(Object.fromEntries(Object.entries({
134
- ...flags,
135
- ...sharedFlags
136
- }).filter(([_key, value])=>{
137
- var _value_type;
138
- return !(value === null || value === void 0 ? void 0 : (_value_type = value.type) === null || _value_type === void 0 ? void 0 : _value_type.manualParsing);
139
- }).map(([key, value])=>[
140
- key,
141
- typeof value === "object" ? value.type : value
142
- ])), {
143
- permissive: true
144
- });
145
- // Manual parsing of flags to allow for special flags like oneOf(Boolean, String)
146
- for(let i = result["_"].length - 1; i >= 0; --i){
147
- let flag = result["_"][i];
148
- if (!flag.startsWith("-")) continue;
149
- let [flagName, flagValue] = flag.split("=");
150
- let handler = flags[flagName];
151
- // Resolve flagName & handler
152
- while(typeof handler === "string"){
153
- flagName = handler;
154
- handler = flags[handler];
155
- }
156
- if (!handler) continue;
157
- let args = [];
158
- let offset = i + 1;
159
- // --flag value syntax was used so we need to pull `value` from `args`
160
- if (flagValue === undefined) {
161
- // Parse args for current flag
162
- while(result["_"][offset] && !result["_"][offset].startsWith("-")){
163
- args.push(result["_"][offset++]);
164
- }
165
- // Cleanup manually parsed flags + args
166
- result["_"].splice(i, 1 + args.length);
167
- // No args were provided, use default value defined in handler
168
- // One arg was provided, use that directly
169
- // Multiple args were provided so pass them all in an array
170
- flagValue = args.length === 0 ? undefined : args.length === 1 ? args[0] : args;
171
- } else {
172
- // Remove the whole flag from the args array
173
- result["_"].splice(i, 1);
174
- }
175
- // Set the resolved value in the `result` object
176
- result[flagName] = handler.type(flagValue, flagName);
177
- }
178
- // Ensure that the `command` is always the first argument in the `args`.
179
- // This is important so that we don't have to check if a default command
180
- // (build) was used or not from within each plugin.
181
- //
182
- // E.g.: tailwindcss input.css -> _: ['build', 'input.css']
183
- // E.g.: tailwindcss build input.css -> _: ['build', 'input.css']
184
- if (result["_"][0] !== command) {
185
- result["_"].unshift(command);
186
- }
187
- return result;
188
- } catch (err) {
189
- if (err.code === "ARG_UNKNOWN_OPTION") {
190
- (0, _help.help)({
191
- message: err.message,
192
- usage: [
193
- "tailwindcss <command> [options]"
194
- ],
195
- options: sharedFlags
196
- });
197
- process.exit(1);
198
- }
199
- throw err;
200
- }
201
- })();
202
- if (args["--help"]) {
203
- (0, _help.help)({
204
- options: {
205
- ...flags,
206
- ...sharedFlags
207
- },
208
- usage: [
209
- `tailwindcss ${command} [options]`
210
- ]
211
- });
212
- process.exit(0);
213
- }
214
- run(args);
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "init", {
6
- enumerable: true,
7
- get: function() {
8
- return init;
9
- }
10
- });
11
- const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
- const _path = /*#__PURE__*/ _interop_require_default(require("path"));
13
- function _interop_require_default(obj) {
14
- return obj && obj.__esModule ? obj : {
15
- default: obj
16
- };
17
- }
18
- function isESM() {
19
- const pkgPath = _path.default.resolve("./package.json");
20
- try {
21
- let pkg = JSON.parse(_fs.default.readFileSync(pkgPath, "utf8"));
22
- return pkg.type && pkg.type === "module";
23
- } catch (err) {
24
- return false;
25
- }
26
- }
27
- function init(args) {
28
- let messages = [];
29
- let isProjectESM = args["--ts"] || args["--esm"] || isESM();
30
- let syntax = args["--ts"] ? "ts" : isProjectESM ? "js" : "cjs";
31
- let extension = args["--ts"] ? "ts" : "js";
32
- var _args___;
33
- let tailwindConfigLocation = _path.default.resolve((_args___ = args["_"][1]) !== null && _args___ !== void 0 ? _args___ : `./tailwind.config.${extension}`);
34
- if (_fs.default.existsSync(tailwindConfigLocation)) {
35
- messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`);
36
- } else {
37
- let stubContentsFile = _fs.default.readFileSync(args["--full"] ? _path.default.resolve(__dirname, "../../../../stubs/config.full.js") : _path.default.resolve(__dirname, "../../../../stubs/config.simple.js"), "utf8");
38
- let stubFile = _fs.default.readFileSync(_path.default.resolve(__dirname, `../../../../stubs/tailwind.config.${syntax}`), "utf8");
39
- // Drop `content` in the oxide engine to promote auto content
40
- if (true) {
41
- stubContentsFile = stubContentsFile.replace(/ *content: \[\],\n/, "");
42
- }
43
- // Change colors import
44
- stubContentsFile = stubContentsFile.replace("../colors", "tailwindcss/colors");
45
- // Replace contents of {ts,js,cjs} file with the stub {simple,full}.
46
- stubFile = stubFile.replace("__CONFIG__", stubContentsFile.replace("module.exports =", "").trim()).trim() + "\n\n";
47
- _fs.default.writeFileSync(tailwindConfigLocation, stubFile, "utf8");
48
- messages.push(`Created Tailwind CSS config file: ${_path.default.basename(tailwindConfigLocation)}`);
49
- }
50
- if (messages.length > 0) {
51
- console.log();
52
- for (let message of messages){
53
- console.log(message);
54
- }
55
- }
56
- }
package/lib/oxide/cli.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- require("./cli/index");
@@ -1,2 +0,0 @@
1
- "use strict";
2
- module.exports = require("../plugin.js");
package/lib/plugin.js DELETED
@@ -1,100 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _setupTrackingContext = /*#__PURE__*/ _interop_require_default(require("./lib/setupTrackingContext"));
6
- const _processTailwindFeatures = /*#__PURE__*/ _interop_require_default(require("./processTailwindFeatures"));
7
- const _sharedState = require("./lib/sharedState");
8
- const _findAtConfigPath = require("./lib/findAtConfigPath");
9
- const _handleImportAtRules = require("./lib/handleImportAtRules");
10
- function _interop_require_default(obj) {
11
- return obj && obj.__esModule ? obj : {
12
- default: obj
13
- };
14
- }
15
- module.exports = function tailwindcss(configOrPath) {
16
- return {
17
- postcssPlugin: "tailwindcss",
18
- plugins: [
19
- _sharedState.env.DEBUG && function(root) {
20
- console.log("\n");
21
- console.time("JIT TOTAL");
22
- return root;
23
- },
24
- ...true ? (0, _handleImportAtRules.handleImportAtRules)() : [],
25
- function(root, result) {
26
- var _findAtConfigPath1;
27
- // Use the path for the `@config` directive if it exists, otherwise use the
28
- // path for the file being processed
29
- configOrPath = (_findAtConfigPath1 = (0, _findAtConfigPath.findAtConfigPath)(root, result)) !== null && _findAtConfigPath1 !== void 0 ? _findAtConfigPath1 : configOrPath;
30
- let context = (0, _setupTrackingContext.default)(configOrPath);
31
- if (root.type === "document") {
32
- let roots = root.nodes.filter((node)=>node.type === "root");
33
- for (const root of roots){
34
- if (root.type === "root") {
35
- (0, _processTailwindFeatures.default)(context)(root, result);
36
- }
37
- }
38
- return;
39
- }
40
- (0, _processTailwindFeatures.default)(context)(root, result);
41
- },
42
- true && function lightningCssPlugin(_root, result) {
43
- let postcss = require("postcss");
44
- let lightningcss = require("lightningcss");
45
- let browserslist = require("browserslist");
46
- try {
47
- let transformed = lightningcss.transform({
48
- filename: result.opts.from,
49
- code: Buffer.from(result.root.toString()),
50
- minify: false,
51
- sourceMap: !!result.map,
52
- inputSourceMap: result.map ? result.map.toString() : undefined,
53
- targets: typeof process !== "undefined" && process.env.JEST_WORKER_ID ? {
54
- chrome: 106 << 16
55
- } : lightningcss.browserslistToTargets(browserslist(require("../package.json").browserslist)),
56
- drafts: {
57
- nesting: true,
58
- customMedia: true
59
- }
60
- });
61
- var _result_map;
62
- result.map = Object.assign((_result_map = result.map) !== null && _result_map !== void 0 ? _result_map : {}, {
63
- toJSON () {
64
- return transformed.map.toJSON();
65
- },
66
- toString () {
67
- return transformed.map.toString();
68
- }
69
- });
70
- result.root = postcss.parse(transformed.code.toString("utf8"));
71
- } catch (err) {
72
- if (typeof process !== "undefined" && process.env.JEST_WORKER_ID) {
73
- let lines = err.source.split("\n");
74
- err = new Error([
75
- "Error formatting using Lightning CSS:",
76
- "",
77
- ...[
78
- "```css",
79
- ...lines.slice(Math.max(err.loc.line - 3, 0), err.loc.line),
80
- " ".repeat(err.loc.column - 1) + "^-- " + err.toString(),
81
- ...lines.slice(err.loc.line, err.loc.line + 2),
82
- "```"
83
- ]
84
- ].join("\n"));
85
- }
86
- if (Error.captureStackTrace) {
87
- Error.captureStackTrace(err, lightningCssPlugin);
88
- }
89
- throw err;
90
- }
91
- },
92
- _sharedState.env.DEBUG && function(root) {
93
- console.timeEnd("JIT TOTAL");
94
- console.log("\n");
95
- return root;
96
- }
97
- ].filter(Boolean)
98
- };
99
- };
100
- module.exports.postcss = true;
@@ -1,42 +0,0 @@
1
- # tailwindcss/nesting
2
-
3
- This is a PostCSS plugin that wraps [postcss-nested](https://github.com/postcss/postcss-nested) or [postcss-nesting](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting) and acts as a compatibility layer to make sure your nesting plugin of choice properly understands Tailwind's custom syntax like `@apply` and `@screen`.
4
-
5
- Add it to your PostCSS configuration, somewhere before Tailwind itself:
6
-
7
- ```js
8
- // postcss.config.js
9
- module.exports = {
10
- plugins: [
11
- require('postcss-import'),
12
- require('tailwindcss/nesting'),
13
- require('tailwindcss'),
14
- require('autoprefixer'),
15
- ]
16
- }
17
- ```
18
-
19
- By default, it uses the [postcss-nested](https://github.com/postcss/postcss-nested) plugin under the hood, which uses a Sass-like syntax and is the plugin that powers nesting support in the [Tailwind CSS plugin API](https://tailwindcss.com/docs/plugins#css-in-js-syntax).
20
-
21
- If you'd rather use [postcss-nesting](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting) (which is based on the work-in-progress [CSS Nesting](https://drafts.csswg.org/css-nesting-1/) specification), first install the plugin alongside:
22
-
23
- ```shell
24
- npm install postcss-nesting
25
- ```
26
-
27
- Then pass the plugin itself as an argument to `tailwindcss/nesting` in your PostCSS configuration:
28
-
29
- ```js
30
- // postcss.config.js
31
- module.exports = {
32
- plugins: [
33
- require('postcss-import'),
34
- require('tailwindcss/nesting')(require('postcss-nesting')),
35
- require('tailwindcss'),
36
- require('autoprefixer'),
37
- ]
38
- }
39
- ```
40
-
41
- This can also be helpful if for whatever reason you need to use a very specific version of `postcss-nested` and want to override the version we bundle with `tailwindcss/nesting` itself.
42
-
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return _default;
9
- }
10
- });
11
- const _plugin = require("./plugin");
12
- const _default = Object.assign(function(opts) {
13
- return {
14
- postcssPlugin: "tailwindcss/nesting",
15
- Once (root, { result }) {
16
- return (0, _plugin.nesting)(opts)(root, result);
17
- }
18
- };
19
- }, {
20
- postcss: true
21
- });
@@ -1,89 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "nesting", {
6
- enumerable: true,
7
- get: function() {
8
- return nesting;
9
- }
10
- });
11
- const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
12
- const _postcssnested = /*#__PURE__*/ _interop_require_default(require("postcss-nested"));
13
- function _interop_require_default(obj) {
14
- return obj && obj.__esModule ? obj : {
15
- default: obj
16
- };
17
- }
18
- function nesting(opts = _postcssnested.default) {
19
- return (root, result)=>{
20
- root.walkAtRules("screen", (rule)=>{
21
- rule.name = "media";
22
- rule.params = `screen(${rule.params})`;
23
- });
24
- root.walkAtRules("apply", (rule)=>{
25
- rule.before(_postcss.default.decl({
26
- prop: "__apply",
27
- value: rule.params,
28
- source: rule.source
29
- }));
30
- rule.remove();
31
- });
32
- let plugin = (()=>{
33
- var _opts_hasOwnProperty;
34
- if (typeof opts === "function" || typeof opts === "object" && (opts === null || opts === void 0 ? void 0 : (_opts_hasOwnProperty = opts.hasOwnProperty) === null || _opts_hasOwnProperty === void 0 ? void 0 : _opts_hasOwnProperty.call(opts, "postcssPlugin"))) {
35
- return opts;
36
- }
37
- if (typeof opts === "string") {
38
- return require(opts);
39
- }
40
- if (Object.keys(opts).length <= 0) {
41
- return _postcssnested.default;
42
- }
43
- throw new Error("tailwindcss/nesting should be loaded with a nesting plugin.");
44
- })();
45
- (0, _postcss.default)([
46
- plugin
47
- ]).process(root, result.opts).sync();
48
- root.walkDecls("__apply", (decl)=>{
49
- decl.before(_postcss.default.atRule({
50
- name: "apply",
51
- params: decl.value,
52
- source: decl.source
53
- }));
54
- decl.remove();
55
- });
56
- /**
57
- * Use a private PostCSS API to remove the "clean" flag from the entire AST.
58
- * This is done because running process() on the AST will set the "clean"
59
- * flag on all nodes, which we don't want.
60
- *
61
- * This causes downstream plugins using the visitor API to be skipped.
62
- *
63
- * This is guarded because the PostCSS API is not public
64
- * and may change in future versions of PostCSS.
65
- *
66
- * See https://github.com/postcss/postcss/issues/1712 for more details
67
- *
68
- * @param {import('postcss').Node} node
69
- */ function markDirty(node) {
70
- if (!("markDirty" in node)) {
71
- return;
72
- }
73
- // Traverse the tree down to the leaf nodes
74
- if (node.nodes) {
75
- node.nodes.forEach((n)=>markDirty(n));
76
- }
77
- // If it's a leaf node mark it as dirty
78
- // We do this here because marking a node as dirty
79
- // will walk up the tree and mark all parents as dirty
80
- // resulting in a lot of unnecessary work if we did this
81
- // for every single node
82
- if (!node.nodes) {
83
- node.markDirty();
84
- }
85
- }
86
- markDirty(root);
87
- return root;
88
- };
89
- }
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return processTailwindFeatures;
9
- }
10
- });
11
- const _normalizeTailwindDirectives = /*#__PURE__*/ _interop_require_default(require("./lib/normalizeTailwindDirectives"));
12
- const _expandTailwindAtRules = /*#__PURE__*/ _interop_require_default(require("./lib/expandTailwindAtRules"));
13
- const _expandApplyAtRules = /*#__PURE__*/ _interop_require_default(require("./lib/expandApplyAtRules"));
14
- const _evaluateTailwindFunctions = /*#__PURE__*/ _interop_require_default(require("./lib/evaluateTailwindFunctions"));
15
- const _substituteScreenAtRules = /*#__PURE__*/ _interop_require_default(require("./lib/substituteScreenAtRules"));
16
- const _resolveDefaultsAtRules = /*#__PURE__*/ _interop_require_default(require("./lib/resolveDefaultsAtRules"));
17
- const _collapseAdjacentRules = /*#__PURE__*/ _interop_require_default(require("./lib/collapseAdjacentRules"));
18
- const _collapseDuplicateDeclarations = /*#__PURE__*/ _interop_require_default(require("./lib/collapseDuplicateDeclarations"));
19
- const _partitionApplyAtRules = /*#__PURE__*/ _interop_require_default(require("./lib/partitionApplyAtRules"));
20
- const _detectNesting = /*#__PURE__*/ _interop_require_default(require("./lib/detectNesting"));
21
- const _setupContextUtils = require("./lib/setupContextUtils");
22
- const _featureFlags = require("./featureFlags");
23
- function _interop_require_default(obj) {
24
- return obj && obj.__esModule ? obj : {
25
- default: obj
26
- };
27
- }
28
- function processTailwindFeatures(setupContext) {
29
- return function(root, result) {
30
- let { tailwindDirectives , applyDirectives } = (0, _normalizeTailwindDirectives.default)(root);
31
- (0, _detectNesting.default)()(root, result);
32
- // Partition apply rules that are found in the css
33
- // itself.
34
- (0, _partitionApplyAtRules.default)()(root, result);
35
- let context = setupContext({
36
- tailwindDirectives,
37
- applyDirectives,
38
- registerDependency (dependency) {
39
- result.messages.push({
40
- plugin: "tailwindcss",
41
- parent: result.opts.from,
42
- ...dependency
43
- });
44
- },
45
- createContext (tailwindConfig, changedContent) {
46
- return (0, _setupContextUtils.createContext)(tailwindConfig, changedContent, root);
47
- }
48
- })(root, result);
49
- if (context.tailwindConfig.separator === "-") {
50
- throw new Error("The '-' character cannot be used as a custom separator in JIT mode due to parsing ambiguity. Please use another character like '_' instead.");
51
- }
52
- (0, _featureFlags.issueFlagNotices)(context.tailwindConfig);
53
- (0, _expandTailwindAtRules.default)(context)(root, result);
54
- // Partition apply rules that are generated by
55
- // addComponents, addUtilities and so on.
56
- (0, _partitionApplyAtRules.default)()(root, result);
57
- (0, _expandApplyAtRules.default)(context)(root, result);
58
- (0, _evaluateTailwindFunctions.default)(context)(root, result);
59
- (0, _substituteScreenAtRules.default)(context)(root, result);
60
- (0, _resolveDefaultsAtRules.default)(context)(root, result);
61
- (0, _collapseAdjacentRules.default)(context)(root, result);
62
- (0, _collapseDuplicateDeclarations.default)(context)(root, result);
63
- };
64
- }