tailwindcss 0.0.0-insiders.ca1dfd6 → 0.0.0-insiders.ca7b10e

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 (179) hide show
  1. package/LICENSE +1 -2
  2. package/README.md +18 -11
  3. package/dist/chunk-7MHEDNEU.mjs +1 -0
  4. package/dist/chunk-AZANAYY2.mjs +1 -0
  5. package/dist/chunk-YTVGJJD3.mjs +12 -0
  6. package/dist/colors-b_6i0Oi7.d.ts +295 -0
  7. package/dist/colors.d.mts +295 -0
  8. package/dist/colors.d.ts +5 -0
  9. package/dist/colors.js +1 -0
  10. package/dist/colors.mjs +1 -0
  11. package/dist/default-theme.d.mts +1147 -0
  12. package/dist/default-theme.d.ts +1147 -0
  13. package/dist/default-theme.js +1 -0
  14. package/dist/default-theme.mjs +1 -0
  15. package/dist/flatten-color-palette.d.mts +6 -0
  16. package/dist/flatten-color-palette.d.ts +6 -0
  17. package/dist/flatten-color-palette.js +1 -0
  18. package/dist/flatten-color-palette.mjs +1 -0
  19. package/dist/lib.d.mts +264 -0
  20. package/dist/lib.d.ts +3 -0
  21. package/dist/lib.js +33 -0
  22. package/dist/lib.mjs +22 -0
  23. package/dist/plugin.d.mts +11 -0
  24. package/dist/plugin.d.ts +104 -0
  25. package/dist/plugin.js +1 -0
  26. package/dist/plugin.mjs +1 -0
  27. package/dist/resolve-config-BIFUA2FY.d.ts +29 -0
  28. package/dist/resolve-config-QUZ9b-Gn.d.mts +190 -0
  29. package/dist/types-B254mqw1.d.mts +98 -0
  30. package/index.css +866 -0
  31. package/package.json +73 -100
  32. package/preflight.css +375 -0
  33. package/theme.css +453 -0
  34. package/CHANGELOG.md +0 -1758
  35. package/base.css +0 -1
  36. package/colors.js +0 -1
  37. package/components.css +0 -1
  38. package/defaultConfig.js +0 -1
  39. package/defaultTheme.js +0 -1
  40. package/lib/cli-peer-dependencies.js +0 -15
  41. package/lib/cli.js +0 -707
  42. package/lib/constants.js +0 -37
  43. package/lib/corePluginList.js +0 -169
  44. package/lib/corePlugins.js +0 -3525
  45. package/lib/css/LICENSE +0 -25
  46. package/lib/css/preflight.css +0 -354
  47. package/lib/featureFlags.js +0 -57
  48. package/lib/index.js +0 -32
  49. package/lib/lib/collapseAdjacentRules.js +0 -41
  50. package/lib/lib/detectNesting.js +0 -19
  51. package/lib/lib/evaluateTailwindFunctions.js +0 -167
  52. package/lib/lib/expandApplyAtRules.js +0 -228
  53. package/lib/lib/expandTailwindAtRules.js +0 -257
  54. package/lib/lib/generateRules.js +0 -350
  55. package/lib/lib/getModuleDependencies.js +0 -48
  56. package/lib/lib/normalizeTailwindDirectives.js +0 -75
  57. package/lib/lib/resolveDefaultsAtRules.js +0 -128
  58. package/lib/lib/setupContextUtils.js +0 -791
  59. package/lib/lib/setupTrackingContext.js +0 -170
  60. package/lib/lib/setupWatchingContext.js +0 -284
  61. package/lib/lib/sharedState.js +0 -29
  62. package/lib/lib/substituteScreenAtRules.js +0 -24
  63. package/lib/processTailwindFeatures.js +0 -47
  64. package/lib/public/colors.js +0 -333
  65. package/lib/public/create-plugin.js +0 -13
  66. package/lib/public/default-config.js +0 -14
  67. package/lib/public/default-theme.js +0 -14
  68. package/lib/public/resolve-config.js +0 -19
  69. package/lib/util/bigSign.js +0 -8
  70. package/lib/util/buildMediaQuery.js +0 -31
  71. package/lib/util/cloneDeep.js +0 -19
  72. package/lib/util/cloneNodes.js +0 -14
  73. package/lib/util/color.js +0 -84
  74. package/lib/util/configurePlugins.js +0 -18
  75. package/lib/util/createPlugin.js +0 -30
  76. package/lib/util/createUtilityPlugin.js +0 -53
  77. package/lib/util/dataTypes.js +0 -202
  78. package/lib/util/defaults.js +0 -16
  79. package/lib/util/escapeClassName.js +0 -19
  80. package/lib/util/escapeCommas.js +0 -8
  81. package/lib/util/flattenColorPalette.js +0 -19
  82. package/lib/util/getAllConfigs.js +0 -29
  83. package/lib/util/hashConfig.js +0 -16
  84. package/lib/util/isKeyframeRule.js +0 -8
  85. package/lib/util/isPlainObject.js +0 -12
  86. package/lib/util/log.js +0 -35
  87. package/lib/util/nameClass.js +0 -31
  88. package/lib/util/negateValue.js +0 -17
  89. package/lib/util/parseAnimationValue.js +0 -89
  90. package/lib/util/parseDependency.js +0 -63
  91. package/lib/util/parseObjectStyles.js +0 -31
  92. package/lib/util/pluginUtils.js +0 -282
  93. package/lib/util/prefixSelector.js +0 -23
  94. package/lib/util/resolveConfig.js +0 -293
  95. package/lib/util/resolveConfigPath.js +0 -52
  96. package/lib/util/responsive.js +0 -19
  97. package/lib/util/tap.js +0 -9
  98. package/lib/util/toColorValue.js +0 -9
  99. package/lib/util/toPath.js +0 -9
  100. package/lib/util/transformThemeValue.js +0 -53
  101. package/lib/util/withAlphaVariable.js +0 -67
  102. package/nesting/README.md +0 -42
  103. package/nesting/index.js +0 -12
  104. package/nesting/plugin.js +0 -41
  105. package/peers/index.js +0 -77111
  106. package/plugin.js +0 -1
  107. package/prettier.config.js +0 -19
  108. package/resolveConfig.js +0 -1
  109. package/screens.css +0 -1
  110. package/scripts/create-plugin-list.js +0 -10
  111. package/scripts/install-integrations.js +0 -27
  112. package/scripts/rebuildFixtures.js +0 -68
  113. package/src/cli-peer-dependencies.js +0 -9
  114. package/src/cli.js +0 -762
  115. package/src/constants.js +0 -17
  116. package/src/corePluginList.js +0 -1
  117. package/src/corePlugins.js +0 -2382
  118. package/src/css/LICENSE +0 -25
  119. package/src/css/preflight.css +0 -354
  120. package/src/featureFlags.js +0 -48
  121. package/src/index.js +0 -34
  122. package/src/lib/collapseAdjacentRules.js +0 -39
  123. package/src/lib/detectNesting.js +0 -20
  124. package/src/lib/evaluateTailwindFunctions.js +0 -195
  125. package/src/lib/expandApplyAtRules.js +0 -251
  126. package/src/lib/expandTailwindAtRules.js +0 -266
  127. package/src/lib/generateRules.js +0 -320
  128. package/src/lib/getModuleDependencies.js +0 -39
  129. package/src/lib/normalizeTailwindDirectives.js +0 -77
  130. package/src/lib/resolveDefaultsAtRules.js +0 -125
  131. package/src/lib/setupContextUtils.js +0 -775
  132. package/src/lib/setupTrackingContext.js +0 -184
  133. package/src/lib/setupWatchingContext.js +0 -306
  134. package/src/lib/sharedState.js +0 -13
  135. package/src/lib/substituteScreenAtRules.js +0 -16
  136. package/src/processTailwindFeatures.js +0 -43
  137. package/src/public/colors.js +0 -305
  138. package/src/public/create-plugin.js +0 -2
  139. package/src/public/default-config.js +0 -4
  140. package/src/public/default-theme.js +0 -4
  141. package/src/public/resolve-config.js +0 -7
  142. package/src/util/bigSign.js +0 -3
  143. package/src/util/buildMediaQuery.js +0 -24
  144. package/src/util/cloneDeep.js +0 -11
  145. package/src/util/cloneNodes.js +0 -11
  146. package/src/util/color.js +0 -56
  147. package/src/util/configurePlugins.js +0 -23
  148. package/src/util/createPlugin.js +0 -27
  149. package/src/util/createUtilityPlugin.js +0 -37
  150. package/src/util/dataTypes.js +0 -216
  151. package/src/util/defaults.js +0 -11
  152. package/src/util/escapeClassName.js +0 -8
  153. package/src/util/escapeCommas.js +0 -3
  154. package/src/util/flattenColorPalette.js +0 -13
  155. package/src/util/getAllConfigs.js +0 -19
  156. package/src/util/hashConfig.js +0 -5
  157. package/src/util/isKeyframeRule.js +0 -3
  158. package/src/util/isPlainObject.js +0 -8
  159. package/src/util/log.js +0 -28
  160. package/src/util/nameClass.js +0 -26
  161. package/src/util/negateValue.js +0 -14
  162. package/src/util/parseAnimationValue.js +0 -68
  163. package/src/util/parseDependency.js +0 -49
  164. package/src/util/parseObjectStyles.js +0 -19
  165. package/src/util/pluginUtils.js +0 -288
  166. package/src/util/prefixSelector.js +0 -15
  167. package/src/util/resolveConfig.js +0 -282
  168. package/src/util/resolveConfigPath.js +0 -55
  169. package/src/util/responsive.js +0 -10
  170. package/src/util/tap.js +0 -4
  171. package/src/util/toColorValue.js +0 -3
  172. package/src/util/toPath.js +0 -4
  173. package/src/util/transformThemeValue.js +0 -37
  174. package/src/util/withAlphaVariable.js +0 -49
  175. package/stubs/defaultConfig.stub.js +0 -890
  176. package/stubs/defaultPostCssConfig.stub.js +0 -6
  177. package/stubs/simpleConfig.stub.js +0 -8
  178. package/tailwind.css +0 -5
  179. package/variants.css +0 -1
package/lib/css/LICENSE DELETED
@@ -1,25 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Nicolas Gallagher
4
- Copyright (c) Jonathan Neal
5
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
6
- Copyright (c) Adam Wathan
7
- Copyright (c) Jonathan Reinink
8
-
9
- Permission is hereby granted, free of charge, to any person obtaining a copy
10
- of this software and associated documentation files (the "Software"), to deal
11
- in the Software without restriction, including without limitation the rights
12
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- copies of the Software, and to permit persons to whom the Software is
14
- furnished to do so, subject to the following conditions:
15
-
16
- The above copyright notice and this permission notice shall be included in all
17
- copies or substantial portions of the Software.
18
-
19
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
- SOFTWARE.
@@ -1,354 +0,0 @@
1
- /*
2
- 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
3
- 2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
4
- */
5
-
6
- *,
7
- ::before,
8
- ::after {
9
- box-sizing: border-box; /* 1 */
10
- border-width: 0; /* 2 */
11
- border-style: solid; /* 2 */
12
- border-color: currentColor; /* 2 */
13
- }
14
-
15
- /*
16
- 1. Use a consistent sensible line-height in all browsers.
17
- 2. Prevent adjustments of font size after orientation changes in iOS.
18
- 3. Use a more readable tab size.
19
- 4. Use the user's configured `sans` font-family by default.
20
- */
21
-
22
- html {
23
- line-height: 1.5; /* 1 */
24
- -webkit-text-size-adjust: 100%; /* 2 */
25
- -moz-tab-size: 4; /* 3 */
26
- tab-size: 4; /* 3 */
27
- font-family: theme('fontFamily.sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); /* 4 */
28
- }
29
-
30
- /*
31
- 1. Remove the margin in all browsers.
32
- 2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
33
- */
34
-
35
- body {
36
- margin: 0; /* 1 */
37
- line-height: inherit; /* 2 */
38
- }
39
-
40
- /*
41
- 1. Add the correct height in Firefox.
42
- 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
43
- 3. Ensure horizontal rules are visible by default.
44
- */
45
-
46
- hr {
47
- height: 0; /* 1 */
48
- color: inherit; /* 2 */
49
- border-top-width: 1px; /* 3 */
50
- }
51
-
52
- /*
53
- Add the correct text decoration in Chrome, Edge, and Safari.
54
- */
55
-
56
- abbr[title] {
57
- text-decoration: underline dotted;
58
- }
59
-
60
- /*
61
- Remove the default font size and weight for headings.
62
- */
63
-
64
- h1,
65
- h2,
66
- h3,
67
- h4,
68
- h5,
69
- h6 {
70
- font-size: inherit;
71
- font-weight: inherit;
72
- }
73
-
74
- /*
75
- Reset links to optimize for opt-in styling instead of opt-out.
76
- */
77
-
78
- a {
79
- color: inherit;
80
- text-decoration: inherit;
81
- }
82
-
83
- /*
84
- Add the correct font weight in Edge and Safari.
85
- */
86
-
87
- b,
88
- strong {
89
- font-weight: bolder;
90
- }
91
-
92
- /*
93
- 1. Use the user's configured `mono` font family by default.
94
- 2. Correct the odd `em` font sizing in all browsers.
95
- */
96
-
97
- code,
98
- kbd,
99
- samp,
100
- pre {
101
- font-family: theme('fontFamily.mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); /* 1 */
102
- font-size: 1em; /* 2 */
103
- }
104
-
105
- /*
106
- Add the correct font size in all browsers.
107
- */
108
-
109
- small {
110
- font-size: 80%;
111
- }
112
-
113
- /*
114
- Prevent `sub` and `sup` elements from affecting the line height in all browsers.
115
- */
116
-
117
- sub,
118
- sup {
119
- font-size: 75%;
120
- line-height: 0;
121
- position: relative;
122
- vertical-align: baseline;
123
- }
124
-
125
- sub {
126
- bottom: -0.25em;
127
- }
128
-
129
- sup {
130
- top: -0.5em;
131
- }
132
-
133
- /*
134
- 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
135
- 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
136
- 3. Remove gaps between table borders by default.
137
- */
138
-
139
- table {
140
- text-indent: 0; /* 1 */
141
- border-color: inherit; /* 2 */
142
- border-collapse: collapse; /* 3 */
143
- }
144
-
145
- /*
146
- 1. Change the font styles in all browsers.
147
- 2. Remove the margin in Firefox and Safari.
148
- 3. Remove default padding in all browsers.
149
- */
150
-
151
- button,
152
- input,
153
- optgroup,
154
- select,
155
- textarea {
156
- font-family: inherit; /* 1 */
157
- font-size: 100%; /* 1 */
158
- line-height: inherit; /* 1 */
159
- color: inherit; /* 1 */
160
- margin: 0; /* 2 */
161
- padding: 0; /* 3 */
162
- }
163
-
164
- /*
165
- Remove the inheritance of text transform in Edge and Firefox.
166
- */
167
-
168
- button,
169
- select {
170
- text-transform: none;
171
- }
172
-
173
- /*
174
- 1. Correct the inability to style clickable types in iOS and Safari.
175
- 2. Remove default button styles.
176
- */
177
-
178
- button,
179
- [type='button'],
180
- [type='reset'],
181
- [type='submit'] {
182
- -webkit-appearance: button; /* 1 */
183
- background-color: transparent; /* 2 */
184
- background-image: none; /* 2 */
185
- }
186
-
187
- /*
188
- Use the modern Firefox focus style for all focusable elements.
189
- */
190
-
191
- :-moz-focusring {
192
- outline: auto;
193
- }
194
-
195
- /*
196
- Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
197
- */
198
-
199
- :-moz-ui-invalid {
200
- box-shadow: none;
201
- }
202
-
203
- /*
204
- Add the correct vertical alignment in Chrome and Firefox.
205
- */
206
-
207
- progress {
208
- vertical-align: baseline;
209
- }
210
-
211
- /*
212
- Correct the cursor style of increment and decrement buttons in Safari.
213
- */
214
-
215
- ::-webkit-inner-spin-button,
216
- ::-webkit-outer-spin-button {
217
- height: auto;
218
- }
219
-
220
- /*
221
- 1. Correct the odd appearance in Chrome and Safari.
222
- 2. Correct the outline style in Safari.
223
- */
224
-
225
- [type='search'] {
226
- -webkit-appearance: textfield; /* 1 */
227
- outline-offset: -2px; /* 2 */
228
- }
229
-
230
- /*
231
- Remove the inner padding in Chrome and Safari on macOS.
232
- */
233
-
234
- ::-webkit-search-decoration {
235
- -webkit-appearance: none;
236
- }
237
-
238
- /*
239
- 1. Correct the inability to style clickable types in iOS and Safari.
240
- 2. Change font properties to `inherit` in Safari.
241
- */
242
-
243
- ::-webkit-file-upload-button {
244
- -webkit-appearance: button; /* 1 */
245
- font: inherit; /* 2 */
246
- }
247
-
248
- /*
249
- Add the correct display in Chrome and Safari.
250
- */
251
-
252
- summary {
253
- display: list-item;
254
- }
255
-
256
- /*
257
- Removes the default spacing and border for appropriate elements.
258
- */
259
-
260
- blockquote,
261
- dl,
262
- dd,
263
- h1,
264
- h2,
265
- h3,
266
- h4,
267
- h5,
268
- h6,
269
- hr,
270
- figure,
271
- p,
272
- pre {
273
- margin: 0;
274
- }
275
-
276
- fieldset {
277
- margin: 0;
278
- padding: 0;
279
- }
280
-
281
- legend {
282
- padding: 0;
283
- }
284
-
285
- ol,
286
- ul {
287
- list-style: none;
288
- margin: 0;
289
- padding: 0;
290
- }
291
-
292
- /*
293
- Prevent resizing textareas horizontally by default.
294
- */
295
-
296
- textarea {
297
- resize: vertical;
298
- }
299
-
300
- /*
301
- 1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
302
- 2. Set the default placeholder color to the user's configured gray 400 color.
303
- */
304
-
305
- input::placeholder,
306
- textarea::placeholder {
307
- opacity: 1; /* 1 */
308
- color: theme('colors.gray.400', #9ca3af); /* 2 */
309
- }
310
-
311
- /*
312
- Set the default cursor for buttons.
313
- */
314
-
315
- button,
316
- [role="button"] {
317
- cursor: pointer;
318
- }
319
-
320
- /*
321
- 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
322
- 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
323
- This can trigger a poorly considered lint error in some tools but is included by design.
324
- */
325
-
326
- img,
327
- svg,
328
- video,
329
- canvas,
330
- audio,
331
- iframe,
332
- embed,
333
- object {
334
- display: block; /* 1 */
335
- vertical-align: middle; /* 2 */
336
- }
337
-
338
- /*
339
- Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
340
- */
341
-
342
- img,
343
- video {
344
- max-width: 100%;
345
- height: auto;
346
- }
347
-
348
- /*
349
- Ensure the default browser behavior of the `hidden` attribute.
350
- */
351
-
352
- [hidden] {
353
- display: none;
354
- }
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.flagEnabled = flagEnabled;
6
- exports.issueFlagNotices = issueFlagNotices;
7
- exports.default = void 0;
8
- var _chalk = _interopRequireDefault(require("chalk"));
9
- var _log = _interopRequireDefault(require("./util/log"));
10
- function _interopRequireDefault(obj) {
11
- return obj && obj.__esModule ? obj : {
12
- default: obj
13
- };
14
- }
15
- const featureFlags = {
16
- future: [],
17
- experimental: [
18
- 'optimizeUniversalDefaults'
19
- ]
20
- };
21
- function flagEnabled(config, flag) {
22
- if (featureFlags.future.includes(flag)) {
23
- var ref;
24
- var ref1;
25
- return config.future === 'all' || ((ref1 = config === null || config === void 0 ? void 0 : (ref = config.future) === null || ref === void 0 ? void 0 : ref[flag]) !== null && ref1 !== void 0 ? ref1 : false);
26
- }
27
- if (featureFlags.experimental.includes(flag)) {
28
- var ref;
29
- var ref5;
30
- return config.experimental === 'all' || ((ref5 = config === null || config === void 0 ? void 0 : (ref = config.experimental) === null || ref === void 0 ? void 0 : ref[flag]) !== null && ref5 !== void 0 ? ref5 : false);
31
- }
32
- return false;
33
- }
34
- function experimentalFlagsEnabled(config) {
35
- if (config.experimental === 'all') {
36
- return featureFlags.experimental;
37
- }
38
- var ref;
39
- return Object.keys((ref = config === null || config === void 0 ? void 0 : config.experimental) !== null && ref !== void 0 ? ref : {
40
- }).filter((flag)=>featureFlags.experimental.includes(flag) && config.experimental[flag]
41
- );
42
- }
43
- function issueFlagNotices(config) {
44
- if (process.env.JEST_WORKER_ID !== undefined) {
45
- return;
46
- }
47
- if (experimentalFlagsEnabled(config).length > 0) {
48
- const changes = experimentalFlagsEnabled(config).map((s)=>_chalk.default.yellow(s)
49
- ).join(', ');
50
- _log.default.warn([
51
- `You have enabled experimental features: ${changes}`,
52
- 'Experimental features are not covered by semver, may introduce breaking changes, and can change at any time.',
53
- ]);
54
- }
55
- }
56
- var _default = featureFlags;
57
- exports.default = _default;
package/lib/index.js DELETED
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var _setupTrackingContext = _interopRequireDefault(require("./lib/setupTrackingContext"));
3
- var _setupWatchingContext = _interopRequireDefault(require("./lib/setupWatchingContext"));
4
- var _processTailwindFeatures = _interopRequireDefault(require("./processTailwindFeatures"));
5
- var _sharedState = require("./lib/sharedState");
6
- function _interopRequireDefault(obj) {
7
- return obj && obj.__esModule ? obj : {
8
- default: obj
9
- };
10
- }
11
- module.exports = function tailwindcss(configOrPath) {
12
- return {
13
- postcssPlugin: 'tailwindcss',
14
- plugins: [
15
- _sharedState.env.DEBUG && function(root) {
16
- console.log('\n');
17
- console.time('JIT TOTAL');
18
- return root;
19
- },
20
- function(root, result) {
21
- let setupContext = _sharedState.env.TAILWIND_MODE === 'watch' ? (0, _setupWatchingContext).default(configOrPath) : (0, _setupTrackingContext).default(configOrPath);
22
- (0, _processTailwindFeatures).default(setupContext)(root, result);
23
- },
24
- _sharedState.env.DEBUG && function(root) {
25
- console.timeEnd('JIT TOTAL');
26
- console.log('\n');
27
- return root;
28
- },
29
- ].filter(Boolean)
30
- };
31
- };
32
- module.exports.postcss = true;
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = collapseAdjacentRules;
6
- let comparisonMap = {
7
- atrule: [
8
- 'name',
9
- 'params'
10
- ],
11
- rule: [
12
- 'selector'
13
- ]
14
- };
15
- let types = new Set(Object.keys(comparisonMap));
16
- function collapseAdjacentRules() {
17
- return (root)=>{
18
- let currentRule = null;
19
- root.each((node)=>{
20
- if (!types.has(node.type)) {
21
- currentRule = null;
22
- return;
23
- }
24
- if (currentRule === null) {
25
- currentRule = node;
26
- return;
27
- }
28
- let properties = comparisonMap[node.type];
29
- var _property, _property1;
30
- if (node.type === 'atrule' && node.name === 'font-face') {
31
- currentRule = node;
32
- } else if (properties.every((property)=>((_property = node[property]) !== null && _property !== void 0 ? _property : '').replace(/\s+/g, ' ') === ((_property1 = currentRule[property]) !== null && _property1 !== void 0 ? _property1 : '').replace(/\s+/g, ' ')
33
- )) {
34
- currentRule.append(node.nodes);
35
- node.remove();
36
- } else {
37
- currentRule = node;
38
- }
39
- });
40
- };
41
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = _default;
6
- function _default(_context) {
7
- return (root, result)=>{
8
- let found = false;
9
- root.walkRules((rule)=>{
10
- if (found) return false;
11
- rule.walkRules((nestedRule)=>{
12
- found = true;
13
- nestedRule.warn(result, // TODO: Improve this warning message
14
- 'Nested CSS detected, checkout the docs on how to support nesting: https://tailwindcss.com/docs/using-with-preprocessors#nesting');
15
- return false;
16
- });
17
- });
18
- };
19
- }
@@ -1,167 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = _default;
6
- var _dlv = _interopRequireDefault(require("dlv"));
7
- var _didyoumean = _interopRequireDefault(require("didyoumean"));
8
- var _transformThemeValue = _interopRequireDefault(require("../util/transformThemeValue"));
9
- var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser"));
10
- var _buildMediaQuery = _interopRequireDefault(require("../util/buildMediaQuery"));
11
- var _toPath = require("../util/toPath");
12
- function _interopRequireDefault(obj) {
13
- return obj && obj.__esModule ? obj : {
14
- default: obj
15
- };
16
- }
17
- function isObject(input) {
18
- return typeof input === 'object' && input !== null;
19
- }
20
- function findClosestExistingPath(theme, path) {
21
- let parts = (0, _toPath).toPath(path);
22
- do {
23
- parts.pop();
24
- if ((0, _dlv).default(theme, parts) !== undefined) break;
25
- }while (parts.length)
26
- return parts.length ? parts : undefined;
27
- }
28
- function pathToString(path) {
29
- if (typeof path === 'string') return path;
30
- return path.reduce((acc, cur, i)=>{
31
- if (cur.includes('.')) return `${acc}[${cur}]`;
32
- return i === 0 ? cur : `${acc}.${cur}`;
33
- }, '');
34
- }
35
- function list(items) {
36
- return items.map((key)=>`'${key}'`
37
- ).join(', ');
38
- }
39
- function listKeys(obj) {
40
- return list(Object.keys(obj));
41
- }
42
- function validatePath(config, path, defaultValue) {
43
- const pathString = Array.isArray(path) ? pathToString(path) : path.replace(/^['"]+/g, '').replace(/['"]+$/g, '');
44
- const pathSegments = Array.isArray(path) ? path : (0, _toPath).toPath(pathString);
45
- const value = (0, _dlv).default(config.theme, pathString, defaultValue);
46
- if (value === undefined) {
47
- let error = `'${pathString}' does not exist in your theme config.`;
48
- const parentSegments = pathSegments.slice(0, -1);
49
- const parentValue = (0, _dlv).default(config.theme, parentSegments);
50
- if (isObject(parentValue)) {
51
- const validKeys = Object.keys(parentValue).filter((key)=>validatePath(config, [
52
- ...parentSegments,
53
- key
54
- ]).isValid
55
- );
56
- const suggestion = (0, _didyoumean).default(pathSegments[pathSegments.length - 1], validKeys);
57
- if (suggestion) {
58
- error += ` Did you mean '${pathToString([
59
- ...parentSegments,
60
- suggestion
61
- ])}'?`;
62
- } else if (validKeys.length > 0) {
63
- error += ` '${pathToString(parentSegments)}' has the following valid keys: ${list(validKeys)}`;
64
- }
65
- } else {
66
- const closestPath = findClosestExistingPath(config.theme, pathString);
67
- if (closestPath) {
68
- const closestValue = (0, _dlv).default(config.theme, closestPath);
69
- if (isObject(closestValue)) {
70
- error += ` '${pathToString(closestPath)}' has the following keys: ${listKeys(closestValue)}`;
71
- } else {
72
- error += ` '${pathToString(closestPath)}' is not an object.`;
73
- }
74
- } else {
75
- error += ` Your theme has the following top-level keys: ${listKeys(config.theme)}`;
76
- }
77
- }
78
- return {
79
- isValid: false,
80
- error
81
- };
82
- }
83
- if (!(typeof value === 'string' || typeof value === 'number' || typeof value === 'function' || value instanceof String || value instanceof Number || Array.isArray(value))) {
84
- let error = `'${pathString}' was found but does not resolve to a string.`;
85
- if (isObject(value)) {
86
- let validKeys = Object.keys(value).filter((key)=>validatePath(config, [
87
- ...pathSegments,
88
- key
89
- ]).isValid
90
- );
91
- if (validKeys.length) {
92
- error += ` Did you mean something like '${pathToString([
93
- ...pathSegments,
94
- validKeys[0]
95
- ])}'?`;
96
- }
97
- }
98
- return {
99
- isValid: false,
100
- error
101
- };
102
- }
103
- const [themeSection] = pathSegments;
104
- return {
105
- isValid: true,
106
- value: (0, _transformThemeValue).default(themeSection)(value)
107
- };
108
- }
109
- function extractArgs(node, vNodes, functions) {
110
- vNodes = vNodes.map((vNode)=>resolveVNode(node, vNode, functions)
111
- );
112
- let args = [
113
- ''
114
- ];
115
- for (let vNode of vNodes){
116
- if (vNode.type === 'div' && vNode.value === ',') {
117
- args.push('');
118
- } else {
119
- args[args.length - 1] += _postcssValueParser.default.stringify(vNode);
120
- }
121
- }
122
- return args;
123
- }
124
- function resolveVNode(node, vNode, functions) {
125
- if (vNode.type === 'function' && functions[vNode.value] !== undefined) {
126
- let args = extractArgs(node, vNode.nodes, functions);
127
- vNode.type = 'word';
128
- vNode.value = functions[vNode.value](node, ...args);
129
- }
130
- return vNode;
131
- }
132
- function resolveFunctions(node, input, functions) {
133
- return (0, _postcssValueParser).default(input).walk((vNode)=>{
134
- resolveVNode(node, vNode, functions);
135
- }).toString();
136
- }
137
- let nodeTypePropertyMap = {
138
- atrule: 'params',
139
- decl: 'value'
140
- };
141
- function _default({ tailwindConfig: config }) {
142
- let functions = {
143
- theme: (node, path, ...defaultValue)=>{
144
- const { isValid , value , error } = validatePath(config, path, defaultValue.length ? defaultValue : undefined);
145
- if (!isValid) {
146
- throw node.error(error);
147
- }
148
- return value;
149
- },
150
- screen: (node, screen)=>{
151
- screen = screen.replace(/^['"]+/g, '').replace(/['"]+$/g, '');
152
- if (config.theme.screens[screen] === undefined) {
153
- throw node.error(`The '${screen}' screen does not exist in your theme.`);
154
- }
155
- return (0, _buildMediaQuery).default(config.theme.screens[screen]);
156
- }
157
- };
158
- return (root)=>{
159
- root.walk((node)=>{
160
- let property = nodeTypePropertyMap[node.type];
161
- if (property === undefined) {
162
- return;
163
- }
164
- node[property] = resolveFunctions(node, node[property], functions);
165
- });
166
- };
167
- }