tailwindcss 0.0.0-insiders.f4635e0 → 0.0.0-insiders.f4a2ccd

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 (238) hide show
  1. package/LICENSE +1 -2
  2. package/README.md +15 -7
  3. package/colors.d.ts +3 -0
  4. package/colors.js +2 -304
  5. package/defaultConfig.d.ts +3 -0
  6. package/defaultConfig.js +2 -4
  7. package/defaultTheme.d.ts +4 -0
  8. package/defaultTheme.js +2 -4
  9. package/lib/cli/build/deps.js +54 -0
  10. package/lib/cli/build/index.js +52 -0
  11. package/lib/cli/build/plugin.js +376 -0
  12. package/lib/cli/build/utils.js +78 -0
  13. package/lib/cli/build/watching.js +180 -0
  14. package/lib/cli/help/index.js +71 -0
  15. package/lib/cli/index.js +230 -0
  16. package/lib/cli/init/index.js +61 -0
  17. package/lib/cli-peer-dependencies.js +22 -14
  18. package/lib/cli.js +4 -762
  19. package/lib/corePluginList.js +182 -5
  20. package/lib/corePlugins.js +4109 -2952
  21. package/lib/css/preflight.css +24 -9
  22. package/lib/featureFlags.js +68 -50
  23. package/lib/index.js +5 -30
  24. package/lib/lib/cacheInvalidation.js +90 -0
  25. package/lib/lib/collapseAdjacentRules.js +52 -36
  26. package/lib/lib/collapseDuplicateDeclarations.js +83 -0
  27. package/lib/lib/content.js +177 -0
  28. package/lib/lib/defaultExtractor.js +241 -0
  29. package/lib/lib/detectNesting.js +39 -17
  30. package/lib/lib/evaluateTailwindFunctions.js +203 -161
  31. package/lib/lib/expandApplyAtRules.js +503 -221
  32. package/lib/lib/expandTailwindAtRules.js +255 -243
  33. package/lib/lib/findAtConfigPath.js +44 -0
  34. package/lib/lib/generateRules.js +831 -317
  35. package/lib/lib/getModuleDependencies.js +93 -49
  36. package/lib/lib/load-config.js +36 -0
  37. package/lib/lib/normalizeTailwindDirectives.js +79 -60
  38. package/lib/lib/offsets.js +304 -0
  39. package/lib/lib/partitionApplyAtRules.js +56 -0
  40. package/lib/lib/regex.js +60 -0
  41. package/lib/lib/remap-bitfield.js +87 -0
  42. package/lib/lib/resolveDefaultsAtRules.js +150 -94
  43. package/lib/lib/setupContextUtils.js +1197 -685
  44. package/lib/lib/setupTrackingContext.js +150 -177
  45. package/lib/lib/sharedState.js +70 -21
  46. package/lib/lib/substituteScreenAtRules.js +26 -28
  47. package/lib/oxide/cli/build/deps.js +81 -0
  48. package/lib/oxide/cli/build/index.js +51 -0
  49. package/lib/oxide/cli/build/plugin.js +373 -0
  50. package/lib/oxide/cli/build/utils.js +77 -0
  51. package/lib/oxide/cli/build/watching.js +177 -0
  52. package/lib/oxide/cli/help/index.js +70 -0
  53. package/lib/oxide/cli/index.js +214 -0
  54. package/lib/oxide/cli/init/index.js +50 -0
  55. package/lib/oxide/cli.js +5 -0
  56. package/lib/oxide/postcss-plugin.js +2 -0
  57. package/lib/plugin.js +98 -0
  58. package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
  59. package/lib/postcss-plugins/nesting/index.js +19 -0
  60. package/lib/postcss-plugins/nesting/plugin.js +87 -0
  61. package/lib/processTailwindFeatures.js +58 -56
  62. package/lib/public/colors.js +353 -0
  63. package/lib/public/create-plugin.js +15 -0
  64. package/lib/public/default-config.js +16 -0
  65. package/lib/public/default-theme.js +16 -0
  66. package/lib/public/load-config.js +10 -0
  67. package/lib/public/resolve-config.js +22 -0
  68. package/lib/util/applyImportantSelector.js +22 -0
  69. package/lib/util/bigSign.js +7 -6
  70. package/lib/util/buildMediaQuery.js +21 -32
  71. package/lib/util/cloneDeep.js +16 -14
  72. package/lib/util/cloneNodes.js +29 -15
  73. package/lib/util/color.js +104 -66
  74. package/lib/util/configurePlugins.js +17 -15
  75. package/lib/util/createPlugin.js +23 -26
  76. package/lib/util/createUtilityPlugin.js +46 -46
  77. package/lib/util/dataTypes.js +266 -0
  78. package/lib/util/defaults.js +20 -15
  79. package/lib/util/escapeClassName.js +18 -17
  80. package/lib/util/escapeCommas.js +7 -6
  81. package/lib/util/flattenColorPalette.js +13 -12
  82. package/lib/util/formatVariantSelector.js +341 -0
  83. package/lib/util/getAllConfigs.js +44 -18
  84. package/lib/util/hashConfig.js +15 -12
  85. package/lib/util/isKeyframeRule.js +7 -6
  86. package/lib/util/isPlainObject.js +11 -11
  87. package/lib/util/isSyntacticallyValidPropertyValue.js +72 -0
  88. package/lib/util/log.js +52 -33
  89. package/lib/util/nameClass.js +35 -29
  90. package/lib/util/negateValue.js +31 -17
  91. package/lib/util/normalizeConfig.js +294 -0
  92. package/lib/util/normalizeScreens.js +170 -0
  93. package/lib/util/parseAnimationValue.js +85 -54
  94. package/lib/util/parseBoxShadowValue.js +84 -0
  95. package/lib/util/parseDependency.js +41 -70
  96. package/lib/util/parseGlob.js +34 -0
  97. package/lib/util/parseObjectStyles.js +30 -24
  98. package/lib/util/pluginUtils.js +234 -288
  99. package/lib/util/prefixSelector.js +33 -19
  100. package/lib/util/removeAlphaVariables.js +29 -0
  101. package/lib/util/resolveConfig.js +221 -256
  102. package/lib/util/resolveConfigPath.js +55 -48
  103. package/lib/util/responsive.js +18 -14
  104. package/lib/util/splitAtTopLevelOnly.js +49 -0
  105. package/lib/util/tap.js +8 -7
  106. package/lib/util/toColorValue.js +7 -6
  107. package/lib/util/toPath.js +27 -8
  108. package/lib/util/transformThemeValue.js +67 -28
  109. package/lib/util/validateConfig.js +24 -0
  110. package/lib/util/validateFormalSyntax.js +24 -0
  111. package/lib/util/withAlphaVariable.js +67 -57
  112. package/loadConfig.d.ts +4 -0
  113. package/loadConfig.js +2 -0
  114. package/nesting/index.js +2 -12
  115. package/package.json +69 -66
  116. package/peers/index.js +76328 -84169
  117. package/plugin.d.ts +11 -0
  118. package/plugin.js +1 -2
  119. package/resolveConfig.d.ts +12 -0
  120. package/resolveConfig.js +2 -7
  121. package/scripts/create-plugin-list.js +2 -2
  122. package/scripts/generate-types.js +105 -0
  123. package/scripts/release-channel.js +18 -0
  124. package/scripts/release-notes.js +21 -0
  125. package/scripts/swap-engines.js +40 -0
  126. package/scripts/type-utils.js +27 -0
  127. package/src/cli/build/deps.js +56 -0
  128. package/src/cli/build/index.js +49 -0
  129. package/src/cli/build/plugin.js +444 -0
  130. package/src/cli/build/utils.js +76 -0
  131. package/src/cli/build/watching.js +229 -0
  132. package/src/cli/help/index.js +70 -0
  133. package/src/cli/index.js +216 -0
  134. package/src/cli/init/index.js +79 -0
  135. package/src/cli-peer-dependencies.js +7 -1
  136. package/src/cli.js +4 -756
  137. package/src/corePluginList.js +1 -1
  138. package/src/corePlugins.js +2526 -1956
  139. package/src/css/preflight.css +24 -9
  140. package/src/featureFlags.js +33 -10
  141. package/src/index.js +4 -33
  142. package/src/lib/cacheInvalidation.js +52 -0
  143. package/src/lib/collapseAdjacentRules.js +21 -2
  144. package/src/lib/collapseDuplicateDeclarations.js +93 -0
  145. package/src/lib/content.js +208 -0
  146. package/src/lib/defaultExtractor.js +217 -0
  147. package/src/lib/detectNesting.js +30 -3
  148. package/src/lib/evaluateTailwindFunctions.js +84 -10
  149. package/src/lib/expandApplyAtRules.js +509 -153
  150. package/src/lib/expandTailwindAtRules.js +125 -104
  151. package/src/lib/findAtConfigPath.js +48 -0
  152. package/src/lib/generateRules.js +678 -70
  153. package/src/lib/getModuleDependencies.js +70 -30
  154. package/src/lib/load-config.ts +27 -0
  155. package/src/lib/normalizeTailwindDirectives.js +10 -3
  156. package/src/lib/offsets.js +373 -0
  157. package/src/lib/partitionApplyAtRules.js +52 -0
  158. package/src/lib/regex.js +74 -0
  159. package/src/lib/remap-bitfield.js +82 -0
  160. package/src/lib/resolveDefaultsAtRules.js +105 -47
  161. package/src/lib/setupContextUtils.js +848 -247
  162. package/src/lib/setupTrackingContext.js +53 -64
  163. package/src/lib/sharedState.js +60 -6
  164. package/src/lib/substituteScreenAtRules.js +6 -3
  165. package/src/oxide/cli/build/deps.ts +91 -0
  166. package/src/oxide/cli/build/index.ts +47 -0
  167. package/src/oxide/cli/build/plugin.ts +442 -0
  168. package/src/oxide/cli/build/utils.ts +74 -0
  169. package/src/oxide/cli/build/watching.ts +225 -0
  170. package/src/oxide/cli/help/index.ts +69 -0
  171. package/src/oxide/cli/index.ts +204 -0
  172. package/src/oxide/cli/init/index.ts +59 -0
  173. package/src/oxide/cli.ts +1 -0
  174. package/src/oxide/postcss-plugin.ts +1 -0
  175. package/src/plugin.js +107 -0
  176. package/src/postcss-plugins/nesting/README.md +42 -0
  177. package/src/postcss-plugins/nesting/index.js +13 -0
  178. package/src/postcss-plugins/nesting/plugin.js +80 -0
  179. package/src/processTailwindFeatures.js +18 -3
  180. package/src/public/colors.js +322 -0
  181. package/src/public/create-plugin.js +2 -0
  182. package/src/public/default-config.js +4 -0
  183. package/src/public/default-theme.js +4 -0
  184. package/src/public/load-config.js +2 -0
  185. package/src/public/resolve-config.js +7 -0
  186. package/src/util/applyImportantSelector.js +19 -0
  187. package/src/util/buildMediaQuery.js +14 -16
  188. package/src/util/cloneNodes.js +19 -2
  189. package/src/util/color.js +43 -11
  190. package/src/util/createUtilityPlugin.js +2 -11
  191. package/src/util/dataTypes.js +281 -0
  192. package/src/util/defaults.js +6 -0
  193. package/src/util/formatVariantSelector.js +412 -0
  194. package/src/util/getAllConfigs.js +21 -2
  195. package/src/util/isSyntacticallyValidPropertyValue.js +61 -0
  196. package/src/util/log.js +23 -22
  197. package/src/util/nameClass.js +6 -2
  198. package/src/util/negateValue.js +15 -5
  199. package/src/util/normalizeConfig.js +318 -0
  200. package/src/util/normalizeScreens.js +140 -0
  201. package/src/util/parseAnimationValue.js +7 -1
  202. package/src/util/parseBoxShadowValue.js +72 -0
  203. package/src/util/parseDependency.js +37 -38
  204. package/src/util/parseGlob.js +24 -0
  205. package/src/util/pluginUtils.js +219 -219
  206. package/src/util/prefixSelector.js +30 -13
  207. package/src/util/removeAlphaVariables.js +24 -0
  208. package/src/util/resolveConfig.js +86 -91
  209. package/src/util/resolveConfigPath.js +12 -1
  210. package/src/util/splitAtTopLevelOnly.js +52 -0
  211. package/src/util/toPath.js +23 -1
  212. package/src/util/transformThemeValue.js +33 -8
  213. package/src/util/validateConfig.js +13 -0
  214. package/src/util/validateFormalSyntax.js +34 -0
  215. package/src/util/withAlphaVariable.js +14 -9
  216. package/stubs/.gitignore +1 -0
  217. package/stubs/.prettierrc.json +6 -0
  218. package/stubs/{defaultConfig.stub.js → config.full.js} +332 -249
  219. package/stubs/{simpleConfig.stub.js → config.simple.js} +0 -1
  220. package/stubs/postcss.config.js +6 -0
  221. package/stubs/tailwind.config.cjs +2 -0
  222. package/stubs/tailwind.config.js +2 -0
  223. package/stubs/tailwind.config.ts +3 -0
  224. package/types/config.d.ts +373 -0
  225. package/types/generated/.gitkeep +0 -0
  226. package/types/generated/colors.d.ts +298 -0
  227. package/types/generated/corePluginList.d.ts +1 -0
  228. package/types/generated/default-theme.d.ts +347 -0
  229. package/types/index.d.ts +7 -0
  230. package/CHANGELOG.md +0 -1742
  231. package/lib/constants.js +0 -37
  232. package/lib/lib/setupWatchingContext.js +0 -331
  233. package/nesting/plugin.js +0 -41
  234. package/scripts/install-integrations.js +0 -27
  235. package/scripts/rebuildFixtures.js +0 -68
  236. package/src/constants.js +0 -17
  237. package/src/lib/setupWatchingContext.js +0 -307
  238. /package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -0
@@ -0,0 +1,42 @@
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
+
@@ -0,0 +1,13 @@
1
+ import { nesting } from './plugin'
2
+
3
+ export default Object.assign(
4
+ function (opts) {
5
+ return {
6
+ postcssPlugin: 'tailwindcss/nesting',
7
+ Once(root, { result }) {
8
+ return nesting(opts)(root, result)
9
+ },
10
+ }
11
+ },
12
+ { postcss: true }
13
+ )
@@ -0,0 +1,80 @@
1
+ import postcss from 'postcss'
2
+ import postcssNested from 'postcss-nested'
3
+
4
+ export function nesting(opts = postcssNested) {
5
+ return (root, result) => {
6
+ root.walkAtRules('screen', (rule) => {
7
+ rule.name = 'media'
8
+ rule.params = `screen(${rule.params})`
9
+ })
10
+
11
+ root.walkAtRules('apply', (rule) => {
12
+ rule.before(postcss.decl({ prop: '__apply', value: rule.params, source: rule.source }))
13
+ rule.remove()
14
+ })
15
+
16
+ let plugin = (() => {
17
+ if (
18
+ typeof opts === 'function' ||
19
+ (typeof opts === 'object' && opts?.hasOwnProperty?.('postcssPlugin'))
20
+ ) {
21
+ return opts
22
+ }
23
+
24
+ if (typeof opts === 'string') {
25
+ return require(opts)
26
+ }
27
+
28
+ if (Object.keys(opts).length <= 0) {
29
+ return postcssNested
30
+ }
31
+
32
+ throw new Error('tailwindcss/nesting should be loaded with a nesting plugin.')
33
+ })()
34
+
35
+ postcss([plugin]).process(root, result.opts).sync()
36
+
37
+ root.walkDecls('__apply', (decl) => {
38
+ decl.before(postcss.atRule({ name: 'apply', params: decl.value, source: decl.source }))
39
+ decl.remove()
40
+ })
41
+
42
+ /**
43
+ * Use a private PostCSS API to remove the "clean" flag from the entire AST.
44
+ * This is done because running process() on the AST will set the "clean"
45
+ * flag on all nodes, which we don't want.
46
+ *
47
+ * This causes downstream plugins using the visitor API to be skipped.
48
+ *
49
+ * This is guarded because the PostCSS API is not public
50
+ * and may change in future versions of PostCSS.
51
+ *
52
+ * See https://github.com/postcss/postcss/issues/1712 for more details
53
+ *
54
+ * @param {import('postcss').Node} node
55
+ */
56
+ function markDirty(node) {
57
+ if (!('markDirty' in node)) {
58
+ return
59
+ }
60
+
61
+ // Traverse the tree down to the leaf nodes
62
+ if (node.nodes) {
63
+ node.nodes.forEach((n) => markDirty(n))
64
+ }
65
+
66
+ // If it's a leaf node mark it as dirty
67
+ // We do this here because marking a node as dirty
68
+ // will walk up the tree and mark all parents as dirty
69
+ // resulting in a lot of unnecessary work if we did this
70
+ // for every single node
71
+ if (!node.nodes) {
72
+ node.markDirty()
73
+ }
74
+ }
75
+
76
+ markDirty(root)
77
+
78
+ return root
79
+ }
80
+ }
@@ -5,15 +5,25 @@ import evaluateTailwindFunctions from './lib/evaluateTailwindFunctions'
5
5
  import substituteScreenAtRules from './lib/substituteScreenAtRules'
6
6
  import resolveDefaultsAtRules from './lib/resolveDefaultsAtRules'
7
7
  import collapseAdjacentRules from './lib/collapseAdjacentRules'
8
+ import collapseDuplicateDeclarations from './lib/collapseDuplicateDeclarations'
9
+ import partitionApplyAtRules from './lib/partitionApplyAtRules'
8
10
  import detectNesting from './lib/detectNesting'
9
11
  import { createContext } from './lib/setupContextUtils'
12
+ import { issueFlagNotices } from './featureFlags'
10
13
 
11
14
  export default function processTailwindFeatures(setupContext) {
12
15
  return function (root, result) {
13
- let tailwindDirectives = normalizeTailwindDirectives(root)
16
+ let { tailwindDirectives, applyDirectives } = normalizeTailwindDirectives(root)
17
+
18
+ detectNesting()(root, result)
19
+
20
+ // Partition apply rules that are found in the css
21
+ // itself.
22
+ partitionApplyAtRules()(root, result)
14
23
 
15
24
  let context = setupContext({
16
25
  tailwindDirectives,
26
+ applyDirectives,
17
27
  registerDependency(dependency) {
18
28
  result.messages.push({
19
29
  plugin: 'tailwindcss',
@@ -22,7 +32,7 @@ export default function processTailwindFeatures(setupContext) {
22
32
  })
23
33
  },
24
34
  createContext(tailwindConfig, changedContent) {
25
- return createContext(tailwindConfig, changedContent, tailwindDirectives, root)
35
+ return createContext(tailwindConfig, changedContent, root)
26
36
  },
27
37
  })(root, result)
28
38
 
@@ -32,12 +42,17 @@ export default function processTailwindFeatures(setupContext) {
32
42
  )
33
43
  }
34
44
 
35
- detectNesting(context)(root, result)
45
+ issueFlagNotices(context.tailwindConfig)
46
+
36
47
  expandTailwindAtRules(context)(root, result)
48
+ // Partition apply rules that are generated by
49
+ // addComponents, addUtilities and so on.
50
+ partitionApplyAtRules()(root, result)
37
51
  expandApplyAtRules(context)(root, result)
38
52
  evaluateTailwindFunctions(context)(root, result)
39
53
  substituteScreenAtRules(context)(root, result)
40
54
  resolveDefaultsAtRules(context)(root, result)
41
55
  collapseAdjacentRules(context)(root, result)
56
+ collapseDuplicateDeclarations(context)(root, result)
42
57
  }
43
58
  }
@@ -0,0 +1,322 @@
1
+ import log from '../util/log'
2
+
3
+ function warn({ version, from, to }) {
4
+ log.warn(`${from}-color-renamed`, [
5
+ `As of Tailwind CSS ${version}, \`${from}\` has been renamed to \`${to}\`.`,
6
+ 'Update your configuration file to silence this warning.',
7
+ ])
8
+ }
9
+
10
+ export default {
11
+ inherit: 'inherit',
12
+ current: 'currentColor',
13
+ transparent: 'transparent',
14
+ black: '#000',
15
+ white: '#fff',
16
+ slate: {
17
+ 50: '#f8fafc',
18
+ 100: '#f1f5f9',
19
+ 200: '#e2e8f0',
20
+ 300: '#cbd5e1',
21
+ 400: '#94a3b8',
22
+ 500: '#64748b',
23
+ 600: '#475569',
24
+ 700: '#334155',
25
+ 800: '#1e293b',
26
+ 900: '#0f172a',
27
+ 950: '#020617',
28
+ },
29
+ gray: {
30
+ 50: '#f9fafb',
31
+ 100: '#f3f4f6',
32
+ 200: '#e5e7eb',
33
+ 300: '#d1d5db',
34
+ 400: '#9ca3af',
35
+ 500: '#6b7280',
36
+ 600: '#4b5563',
37
+ 700: '#374151',
38
+ 800: '#1f2937',
39
+ 900: '#111827',
40
+ 950: '#030712',
41
+ },
42
+ zinc: {
43
+ 50: '#fafafa',
44
+ 100: '#f4f4f5',
45
+ 200: '#e4e4e7',
46
+ 300: '#d4d4d8',
47
+ 400: '#a1a1aa',
48
+ 500: '#71717a',
49
+ 600: '#52525b',
50
+ 700: '#3f3f46',
51
+ 800: '#27272a',
52
+ 900: '#18181b',
53
+ 950: '#09090b',
54
+ },
55
+ neutral: {
56
+ 50: '#fafafa',
57
+ 100: '#f5f5f5',
58
+ 200: '#e5e5e5',
59
+ 300: '#d4d4d4',
60
+ 400: '#a3a3a3',
61
+ 500: '#737373',
62
+ 600: '#525252',
63
+ 700: '#404040',
64
+ 800: '#262626',
65
+ 900: '#171717',
66
+ 950: '#0a0a0a',
67
+ },
68
+ stone: {
69
+ 50: '#fafaf9',
70
+ 100: '#f5f5f4',
71
+ 200: '#e7e5e4',
72
+ 300: '#d6d3d1',
73
+ 400: '#a8a29e',
74
+ 500: '#78716c',
75
+ 600: '#57534e',
76
+ 700: '#44403c',
77
+ 800: '#292524',
78
+ 900: '#1c1917',
79
+ 950: '#0c0a09',
80
+ },
81
+ red: {
82
+ 50: '#fef2f2',
83
+ 100: '#fee2e2',
84
+ 200: '#fecaca',
85
+ 300: '#fca5a5',
86
+ 400: '#f87171',
87
+ 500: '#ef4444',
88
+ 600: '#dc2626',
89
+ 700: '#b91c1c',
90
+ 800: '#991b1b',
91
+ 900: '#7f1d1d',
92
+ 950: '#450a0a',
93
+ },
94
+ orange: {
95
+ 50: '#fff7ed',
96
+ 100: '#ffedd5',
97
+ 200: '#fed7aa',
98
+ 300: '#fdba74',
99
+ 400: '#fb923c',
100
+ 500: '#f97316',
101
+ 600: '#ea580c',
102
+ 700: '#c2410c',
103
+ 800: '#9a3412',
104
+ 900: '#7c2d12',
105
+ 950: '#431407',
106
+ },
107
+ amber: {
108
+ 50: '#fffbeb',
109
+ 100: '#fef3c7',
110
+ 200: '#fde68a',
111
+ 300: '#fcd34d',
112
+ 400: '#fbbf24',
113
+ 500: '#f59e0b',
114
+ 600: '#d97706',
115
+ 700: '#b45309',
116
+ 800: '#92400e',
117
+ 900: '#78350f',
118
+ 950: '#451a03',
119
+ },
120
+ yellow: {
121
+ 50: '#fefce8',
122
+ 100: '#fef9c3',
123
+ 200: '#fef08a',
124
+ 300: '#fde047',
125
+ 400: '#facc15',
126
+ 500: '#eab308',
127
+ 600: '#ca8a04',
128
+ 700: '#a16207',
129
+ 800: '#854d0e',
130
+ 900: '#713f12',
131
+ 950: '#422006',
132
+ },
133
+ lime: {
134
+ 50: '#f7fee7',
135
+ 100: '#ecfccb',
136
+ 200: '#d9f99d',
137
+ 300: '#bef264',
138
+ 400: '#a3e635',
139
+ 500: '#84cc16',
140
+ 600: '#65a30d',
141
+ 700: '#4d7c0f',
142
+ 800: '#3f6212',
143
+ 900: '#365314',
144
+ 950: '#1a2e05',
145
+ },
146
+ green: {
147
+ 50: '#f0fdf4',
148
+ 100: '#dcfce7',
149
+ 200: '#bbf7d0',
150
+ 300: '#86efac',
151
+ 400: '#4ade80',
152
+ 500: '#22c55e',
153
+ 600: '#16a34a',
154
+ 700: '#15803d',
155
+ 800: '#166534',
156
+ 900: '#14532d',
157
+ 950: '#052e16',
158
+ },
159
+ emerald: {
160
+ 50: '#ecfdf5',
161
+ 100: '#d1fae5',
162
+ 200: '#a7f3d0',
163
+ 300: '#6ee7b7',
164
+ 400: '#34d399',
165
+ 500: '#10b981',
166
+ 600: '#059669',
167
+ 700: '#047857',
168
+ 800: '#065f46',
169
+ 900: '#064e3b',
170
+ 950: '#022c22',
171
+ },
172
+ teal: {
173
+ 50: '#f0fdfa',
174
+ 100: '#ccfbf1',
175
+ 200: '#99f6e4',
176
+ 300: '#5eead4',
177
+ 400: '#2dd4bf',
178
+ 500: '#14b8a6',
179
+ 600: '#0d9488',
180
+ 700: '#0f766e',
181
+ 800: '#115e59',
182
+ 900: '#134e4a',
183
+ 950: '#042f2e',
184
+ },
185
+ cyan: {
186
+ 50: '#ecfeff',
187
+ 100: '#cffafe',
188
+ 200: '#a5f3fc',
189
+ 300: '#67e8f9',
190
+ 400: '#22d3ee',
191
+ 500: '#06b6d4',
192
+ 600: '#0891b2',
193
+ 700: '#0e7490',
194
+ 800: '#155e75',
195
+ 900: '#164e63',
196
+ 950: '#083344',
197
+ },
198
+ sky: {
199
+ 50: '#f0f9ff',
200
+ 100: '#e0f2fe',
201
+ 200: '#bae6fd',
202
+ 300: '#7dd3fc',
203
+ 400: '#38bdf8',
204
+ 500: '#0ea5e9',
205
+ 600: '#0284c7',
206
+ 700: '#0369a1',
207
+ 800: '#075985',
208
+ 900: '#0c4a6e',
209
+ 950: '#082f49',
210
+ },
211
+ blue: {
212
+ 50: '#eff6ff',
213
+ 100: '#dbeafe',
214
+ 200: '#bfdbfe',
215
+ 300: '#93c5fd',
216
+ 400: '#60a5fa',
217
+ 500: '#3b82f6',
218
+ 600: '#2563eb',
219
+ 700: '#1d4ed8',
220
+ 800: '#1e40af',
221
+ 900: '#1e3a8a',
222
+ 950: '#172554',
223
+ },
224
+ indigo: {
225
+ 50: '#eef2ff',
226
+ 100: '#e0e7ff',
227
+ 200: '#c7d2fe',
228
+ 300: '#a5b4fc',
229
+ 400: '#818cf8',
230
+ 500: '#6366f1',
231
+ 600: '#4f46e5',
232
+ 700: '#4338ca',
233
+ 800: '#3730a3',
234
+ 900: '#312e81',
235
+ 950: '#1e1b4b',
236
+ },
237
+ violet: {
238
+ 50: '#f5f3ff',
239
+ 100: '#ede9fe',
240
+ 200: '#ddd6fe',
241
+ 300: '#c4b5fd',
242
+ 400: '#a78bfa',
243
+ 500: '#8b5cf6',
244
+ 600: '#7c3aed',
245
+ 700: '#6d28d9',
246
+ 800: '#5b21b6',
247
+ 900: '#4c1d95',
248
+ 950: '#2e1065',
249
+ },
250
+ purple: {
251
+ 50: '#faf5ff',
252
+ 100: '#f3e8ff',
253
+ 200: '#e9d5ff',
254
+ 300: '#d8b4fe',
255
+ 400: '#c084fc',
256
+ 500: '#a855f7',
257
+ 600: '#9333ea',
258
+ 700: '#7e22ce',
259
+ 800: '#6b21a8',
260
+ 900: '#581c87',
261
+ 950: '#3b0764',
262
+ },
263
+ fuchsia: {
264
+ 50: '#fdf4ff',
265
+ 100: '#fae8ff',
266
+ 200: '#f5d0fe',
267
+ 300: '#f0abfc',
268
+ 400: '#e879f9',
269
+ 500: '#d946ef',
270
+ 600: '#c026d3',
271
+ 700: '#a21caf',
272
+ 800: '#86198f',
273
+ 900: '#701a75',
274
+ 950: '#4a044e',
275
+ },
276
+ pink: {
277
+ 50: '#fdf2f8',
278
+ 100: '#fce7f3',
279
+ 200: '#fbcfe8',
280
+ 300: '#f9a8d4',
281
+ 400: '#f472b6',
282
+ 500: '#ec4899',
283
+ 600: '#db2777',
284
+ 700: '#be185d',
285
+ 800: '#9d174d',
286
+ 900: '#831843',
287
+ 950: '#500724',
288
+ },
289
+ rose: {
290
+ 50: '#fff1f2',
291
+ 100: '#ffe4e6',
292
+ 200: '#fecdd3',
293
+ 300: '#fda4af',
294
+ 400: '#fb7185',
295
+ 500: '#f43f5e',
296
+ 600: '#e11d48',
297
+ 700: '#be123c',
298
+ 800: '#9f1239',
299
+ 900: '#881337',
300
+ 950: '#4c0519',
301
+ },
302
+ get lightBlue() {
303
+ warn({ version: 'v2.2', from: 'lightBlue', to: 'sky' })
304
+ return this.sky
305
+ },
306
+ get warmGray() {
307
+ warn({ version: 'v3.0', from: 'warmGray', to: 'stone' })
308
+ return this.stone
309
+ },
310
+ get trueGray() {
311
+ warn({ version: 'v3.0', from: 'trueGray', to: 'neutral' })
312
+ return this.neutral
313
+ },
314
+ get coolGray() {
315
+ warn({ version: 'v3.0', from: 'coolGray', to: 'gray' })
316
+ return this.gray
317
+ },
318
+ get blueGray() {
319
+ warn({ version: 'v3.0', from: 'blueGray', to: 'slate' })
320
+ return this.slate
321
+ },
322
+ }
@@ -0,0 +1,2 @@
1
+ import createPlugin from '../util/createPlugin'
2
+ export default createPlugin
@@ -0,0 +1,4 @@
1
+ import { cloneDeep } from '../util/cloneDeep'
2
+ import defaultConfig from '../../stubs/config.full'
3
+
4
+ export default cloneDeep(defaultConfig)
@@ -0,0 +1,4 @@
1
+ import { cloneDeep } from '../util/cloneDeep'
2
+ import defaultFullConfig from '../../stubs/config.full'
3
+
4
+ export default cloneDeep(defaultFullConfig.theme)
@@ -0,0 +1,2 @@
1
+ import { loadConfig } from '../lib/load-config'
2
+ export default loadConfig
@@ -0,0 +1,7 @@
1
+ import resolveConfigObjects from '../util/resolveConfig'
2
+ import getAllConfigs from '../util/getAllConfigs'
3
+
4
+ export default function resolveConfig(...configs) {
5
+ let [, ...defaultConfigs] = getAllConfigs(configs[0])
6
+ return resolveConfigObjects([...configs, ...defaultConfigs])
7
+ }
@@ -0,0 +1,19 @@
1
+ import { splitAtTopLevelOnly } from './splitAtTopLevelOnly'
2
+
3
+ export function applyImportantSelector(selector, important) {
4
+ let matches = /^(.*?)(:before|:after|::[\w-]+)(\)*)$/g.exec(selector)
5
+ if (!matches) return `${important} ${wrapWithIs(selector)}`
6
+
7
+ let [, before, pseudo, brackets] = matches
8
+ return `${important} ${wrapWithIs(before + brackets)}${pseudo}`
9
+ }
10
+
11
+ function wrapWithIs(selector) {
12
+ let parts = splitAtTopLevelOnly(selector, ' ')
13
+
14
+ if (parts.length === 1 && parts[0].startsWith(':is(') && parts[0].endsWith(')')) {
15
+ return selector
16
+ }
17
+
18
+ return `:is(${selector})`
19
+ }
@@ -1,24 +1,22 @@
1
1
  export default function buildMediaQuery(screens) {
2
- if (typeof screens === 'string') {
3
- screens = { min: screens }
4
- }
5
-
6
- if (!Array.isArray(screens)) {
7
- screens = [screens]
8
- }
2
+ screens = Array.isArray(screens) ? screens : [screens]
9
3
 
10
4
  return screens
11
5
  .map((screen) => {
12
- if (screen?.hasOwnProperty?.('raw')) {
13
- return screen.raw
14
- }
6
+ let values = screen.values.map((screen) => {
7
+ if (screen.raw !== undefined) {
8
+ return screen.raw
9
+ }
10
+
11
+ return [
12
+ screen.min && `(min-width: ${screen.min})`,
13
+ screen.max && `(max-width: ${screen.max})`,
14
+ ]
15
+ .filter(Boolean)
16
+ .join(' and ')
17
+ })
15
18
 
16
- return Object.entries(screen)
17
- .map(([feature, value]) => {
18
- feature = { min: 'min-width', max: 'max-width' }[feature] ?? feature
19
- return `(${feature}: ${value})`
20
- })
21
- .join(' and ')
19
+ return screen.not ? `not all and ${values}` : values
22
20
  })
23
21
  .join(', ')
24
22
  }
@@ -1,9 +1,26 @@
1
- export default function cloneNodes(nodes, source) {
1
+ export default function cloneNodes(nodes, source = undefined, raws = undefined) {
2
2
  return nodes.map((node) => {
3
3
  let cloned = node.clone()
4
4
 
5
- if (source !== undefined) {
5
+ // We always want override the source map
6
+ // except when explicitly told not to
7
+ let shouldOverwriteSource = node.raws.tailwind?.preserveSource !== true || !cloned.source
8
+
9
+ if (source !== undefined && shouldOverwriteSource) {
6
10
  cloned.source = source
11
+
12
+ if ('walk' in cloned) {
13
+ cloned.walk((child) => {
14
+ child.source = source
15
+ })
16
+ }
17
+ }
18
+
19
+ if (raws !== undefined) {
20
+ cloned.raws.tailwind = {
21
+ ...cloned.raws.tailwind,
22
+ ...raws,
23
+ }
7
24
  }
8
25
 
9
26
  return cloned