tailwindcss 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  <p align="center">
2
2
  <a href="https://tailwindcss.com" target="_blank">
3
3
  <picture>
4
- <source media="(prefers-color-scheme: dark)" srcset="./.github/logo-dark.svg">
5
- <source media="(prefers-color-scheme: light)" srcset="./.github/logo-light.svg">
6
- <img alt="Tailwind CSS" src="./.github/logo-light.svg" width="350" height="70" style="max-width: 100%;">
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tailwindlabs/tailwindcss/HEAD/.github/logo-dark.svg">
5
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/tailwindlabs/tailwindcss/HEAD/.github/logo-light.svg">
6
+ <img alt="Tailwind CSS" src="https://raw.githubusercontent.com/tailwindlabs/tailwindcss/HEAD/.github/logo-light.svg" width="350" height="70" style="max-width: 100%;">
7
7
  </picture>
8
8
  </a>
9
9
  </p>
@@ -283,6 +283,22 @@ async function createProcessor(args, cliConfigPath) {
283
283
  from: input,
284
284
  to: output
285
285
  })).then((result)=>{
286
+ if (!state.watcher) {
287
+ return result;
288
+ }
289
+ _shared.env.DEBUG && console.time("Recording PostCSS dependencies");
290
+ for (let message of result.messages){
291
+ if (message.type === "dependency") {
292
+ state.contextDependencies.add(message.file);
293
+ }
294
+ }
295
+ _shared.env.DEBUG && console.timeEnd("Recording PostCSS dependencies");
296
+ // TODO: This needs to be in a different spot
297
+ _shared.env.DEBUG && console.time("Watch new files");
298
+ state.watcher.refreshWatchedFiles();
299
+ _shared.env.DEBUG && console.timeEnd("Watch new files");
300
+ return result;
301
+ }).then((result)=>{
286
302
  if (!output) {
287
303
  process.stdout.write(result.css);
288
304
  return;
@@ -52,7 +52,7 @@ function createWatcher(args, { state , rebuild }) {
52
52
  content,
53
53
  extension: _path.default.extname(file).slice(1)
54
54
  });
55
- chain = chain.then(()=>rebuild(changedContent));
55
+ chain = chain.then(()=>rebuild(changedContent.splice(0)));
56
56
  return chain;
57
57
  }
58
58
  watcher.on("change", (file)=>recordChangedFile(file));
@@ -212,11 +212,12 @@ function coerceValue(types, modifier, options, tailwindConfig) {
212
212
  }
213
213
  function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
214
214
  let modifiersEnabled = (0, _featureFlagsJs.flagEnabled)(tailwindConfig, "generalizedModifiers");
215
- let canUseUtilityModifier = modifiersEnabled && options.modifiers != null && (options.modifiers === "any" || typeof options.modifiers === "object");
216
- let [modifier, utilityModifier] = canUseUtilityModifier ? splitUtilityModifier(rawModifier) : [
217
- rawModifier,
218
- undefined
219
- ];
215
+ let [modifier, utilityModifier] = splitUtilityModifier(rawModifier);
216
+ let canUseUtilityModifier = modifiersEnabled && options.modifiers != null && (options.modifiers === "any" || typeof options.modifiers === "object" && (utilityModifier && isArbitraryValue(utilityModifier) || utilityModifier in options.modifiers));
217
+ if (!canUseUtilityModifier) {
218
+ modifier = rawModifier;
219
+ utilityModifier = undefined;
220
+ }
220
221
  if (utilityModifier !== undefined && modifier === "") {
221
222
  modifier = "DEFAULT";
222
223
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -23,7 +23,6 @@
23
23
  "test": "jest",
24
24
  "test:integrations": "npm run test --prefix ./integrations",
25
25
  "install:integrations": "node scripts/install-integrations.js",
26
- "posttest": "npm run style",
27
26
  "generate:plugin-list": "node -r @swc/register scripts/create-plugin-list.js",
28
27
  "generate:types": "node -r @swc/register scripts/generate-types.js",
29
28
  "generate": "npm run generate:plugin-list && npm run generate:types",
@@ -57,7 +56,6 @@
57
56
  "jest": "^28.1.3",
58
57
  "jest-diff": "^28.1.3",
59
58
  "prettier": "^2.7.1",
60
- "prettier-plugin-tailwindcss": "^0.1.13",
61
59
  "rimraf": "^3.0.0",
62
60
  "source-map-js": "^1.0.2"
63
61
  },
@@ -75,6 +73,7 @@
75
73
  "glob-parent": "^6.0.2",
76
74
  "is-glob": "^4.0.3",
77
75
  "lilconfig": "^2.0.6",
76
+ "micromatch": "^4.0.5",
78
77
  "normalize-path": "^3.0.0",
79
78
  "object-hash": "^3.0.0",
80
79
  "picocolors": "^1.0.0",
package/peers/index.js CHANGED
@@ -56553,44 +56553,49 @@ var require_walker = __commonJS({
56553
56553
  var require_package = __commonJS({
56554
56554
  "node_modules/css-tree/package.json"(exports2, module2) {
56555
56555
  module2.exports = {
56556
- name: "css-tree",
56557
- version: "1.1.3",
56558
- description: "A tool set for CSS: fast detailed parser (CSS \u2192 AST), walker (AST traversal), generator (AST \u2192 CSS) and lexer (validation and matching) based on specs and browser implementations",
56559
- author: "Roman Dvornov <rdvornov@gmail.com> (https://github.com/lahmatiy)",
56560
- license: "MIT",
56561
- repository: "csstree/csstree",
56562
- keywords: [
56563
- "css",
56564
- "ast",
56565
- "tokenizer",
56566
- "parser",
56567
- "walker",
56568
- "lexer",
56569
- "generator",
56570
- "utils",
56571
- "syntax",
56572
- "validation"
56556
+ _args: [
56557
+ [
56558
+ "css-tree@1.1.3",
56559
+ "/home/runner/work/tailwindcss/tailwindcss"
56560
+ ]
56573
56561
  ],
56574
- main: "lib/index.js",
56575
- unpkg: "dist/csstree.min.js",
56576
- jsdelivr: "dist/csstree.min.js",
56577
- scripts: {
56578
- build: "rollup --config",
56579
- lint: "eslint data lib scripts test && node scripts/review-syntax-patch --lint && node scripts/update-docs --lint",
56580
- "lint-and-test": "npm run lint && npm test",
56581
- "update:docs": "node scripts/update-docs",
56582
- "review:syntax-patch": "node scripts/review-syntax-patch",
56583
- test: "mocha --reporter progress",
56584
- coverage: "nyc npm test",
56585
- travis: "nyc npm run lint-and-test && npm run coveralls",
56586
- coveralls: "nyc report --reporter=text-lcov | coveralls",
56587
- prepublishOnly: "npm run build",
56588
- hydrogen: "node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm --trace_hydrogen_file=code.cfg --print-opt-code bin/parse --stat -o /dev/null"
56562
+ _development: true,
56563
+ _from: "css-tree@1.1.3",
56564
+ _id: "css-tree@1.1.3",
56565
+ _inBundle: false,
56566
+ _integrity: "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==",
56567
+ _location: "/css-tree",
56568
+ _phantomChildren: {},
56569
+ _requested: {
56570
+ type: "version",
56571
+ registry: true,
56572
+ raw: "css-tree@1.1.3",
56573
+ name: "css-tree",
56574
+ escapedName: "css-tree",
56575
+ rawSpec: "1.1.3",
56576
+ saveSpec: null,
56577
+ fetchSpec: "1.1.3"
56578
+ },
56579
+ _requiredBy: [
56580
+ "/csso",
56581
+ "/svgo"
56582
+ ],
56583
+ _resolved: "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz",
56584
+ _spec: "1.1.3",
56585
+ _where: "/home/runner/work/tailwindcss/tailwindcss",
56586
+ author: {
56587
+ name: "Roman Dvornov",
56588
+ email: "rdvornov@gmail.com",
56589
+ url: "https://github.com/lahmatiy"
56590
+ },
56591
+ bugs: {
56592
+ url: "https://github.com/csstree/csstree/issues"
56589
56593
  },
56590
56594
  dependencies: {
56591
56595
  "mdn-data": "2.0.14",
56592
56596
  "source-map": "^0.6.1"
56593
56597
  },
56598
+ description: "A tool set for CSS: fast detailed parser (CSS \u2192 AST), walker (AST traversal), generator (AST \u2192 CSS) and lexer (validation and matching) based on specs and browser implementations",
56594
56599
  devDependencies: {
56595
56600
  "@rollup/plugin-commonjs": "^11.0.2",
56596
56601
  "@rollup/plugin-json": "^4.0.2",
@@ -56610,7 +56615,43 @@ var require_package = __commonJS({
56610
56615
  "data",
56611
56616
  "dist",
56612
56617
  "lib"
56613
- ]
56618
+ ],
56619
+ homepage: "https://github.com/csstree/csstree#readme",
56620
+ jsdelivr: "dist/csstree.min.js",
56621
+ keywords: [
56622
+ "css",
56623
+ "ast",
56624
+ "tokenizer",
56625
+ "parser",
56626
+ "walker",
56627
+ "lexer",
56628
+ "generator",
56629
+ "utils",
56630
+ "syntax",
56631
+ "validation"
56632
+ ],
56633
+ license: "MIT",
56634
+ main: "lib/index.js",
56635
+ name: "css-tree",
56636
+ repository: {
56637
+ type: "git",
56638
+ url: "git+https://github.com/csstree/csstree.git"
56639
+ },
56640
+ scripts: {
56641
+ build: "rollup --config",
56642
+ coverage: "nyc npm test",
56643
+ coveralls: "nyc report --reporter=text-lcov | coveralls",
56644
+ hydrogen: "node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm --trace_hydrogen_file=code.cfg --print-opt-code bin/parse --stat -o /dev/null",
56645
+ lint: "eslint data lib scripts test && node scripts/review-syntax-patch --lint && node scripts/update-docs --lint",
56646
+ "lint-and-test": "npm run lint && npm test",
56647
+ prepublishOnly: "npm run build",
56648
+ "review:syntax-patch": "node scripts/review-syntax-patch",
56649
+ test: "mocha --reporter progress",
56650
+ travis: "nyc npm run lint-and-test && npm run coveralls",
56651
+ "update:docs": "node scripts/update-docs"
56652
+ },
56653
+ unpkg: "dist/csstree.min.js",
56654
+ version: "1.1.3"
56614
56655
  };
56615
56656
  }
56616
56657
  });
@@ -60232,50 +60273,50 @@ var require_compress = __commonJS({
60232
60273
  var require_package2 = __commonJS({
60233
60274
  "node_modules/csso/package.json"(exports2, module2) {
60234
60275
  module2.exports = {
60235
- name: "csso",
60236
- version: "4.2.0",
60237
- description: "CSS minifier with structural optimisations",
60238
- homepage: "https://github.com/css/csso",
60239
- author: "Sergey Kryzhanovsky <skryzhanovsky@ya.ru> (https://github.com/afelix)",
60240
- maintainers: [
60241
- {
60242
- name: "Roman Dvornov",
60243
- email: "rdvornov@gmail.com",
60244
- "github-username": "lahmatiy"
60245
- }
60276
+ _args: [
60277
+ [
60278
+ "csso@4.2.0",
60279
+ "/home/runner/work/tailwindcss/tailwindcss"
60280
+ ]
60246
60281
  ],
60247
- license: "MIT",
60248
- repository: "css/csso",
60282
+ _development: true,
60283
+ _from: "csso@4.2.0",
60284
+ _id: "csso@4.2.0",
60285
+ _inBundle: false,
60286
+ _integrity: "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==",
60287
+ _location: "/csso",
60288
+ _phantomChildren: {},
60289
+ _requested: {
60290
+ type: "version",
60291
+ registry: true,
60292
+ raw: "csso@4.2.0",
60293
+ name: "csso",
60294
+ escapedName: "csso",
60295
+ rawSpec: "4.2.0",
60296
+ saveSpec: null,
60297
+ fetchSpec: "4.2.0"
60298
+ },
60299
+ _requiredBy: [
60300
+ "/svgo"
60301
+ ],
60302
+ _resolved: "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz",
60303
+ _spec: "4.2.0",
60304
+ _where: "/home/runner/work/tailwindcss/tailwindcss",
60305
+ author: {
60306
+ name: "Sergey Kryzhanovsky",
60307
+ email: "skryzhanovsky@ya.ru",
60308
+ url: "https://github.com/afelix"
60309
+ },
60310
+ browser: {
60311
+ "css-tree": "css-tree/dist/csstree.min.js"
60312
+ },
60249
60313
  bugs: {
60250
60314
  url: "https://github.com/css/csso/issues"
60251
60315
  },
60252
- keywords: [
60253
- "css",
60254
- "compress",
60255
- "minifier",
60256
- "minify",
60257
- "optimise",
60258
- "optimisation",
60259
- "csstree"
60260
- ],
60261
- main: "./lib/index",
60262
- scripts: {
60263
- test: "mocha --reporter dot",
60264
- lint: "eslint lib test",
60265
- "lint-and-test": "npm run lint && npm test",
60266
- build: "rollup --config && terser dist/csso.js --compress --mangle -o dist/csso.min.js",
60267
- coverage: "nyc npm test",
60268
- coveralls: "nyc report --reporter=text-lcov | coveralls",
60269
- travis: "nyc npm run lint-and-test && npm run coveralls",
60270
- hydrogen: "node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm --trace_hydrogen_file=code.cfg --print-opt-code bin/csso --stat -o /dev/null",
60271
- prepublishOnly: "npm run build"
60272
- },
60273
60316
  dependencies: {
60274
60317
  "css-tree": "^1.1.2"
60275
60318
  },
60276
- browser: {
60277
- "css-tree": "css-tree/dist/csstree.min.js"
60278
- },
60319
+ description: "CSS minifier with structural optimisations",
60279
60320
  devDependencies: {
60280
60321
  "@rollup/plugin-commonjs": "^11.0.1",
60281
60322
  "@rollup/plugin-json": "^4.0.1",
@@ -60294,7 +60335,42 @@ var require_package2 = __commonJS({
60294
60335
  files: [
60295
60336
  "dist",
60296
60337
  "lib"
60297
- ]
60338
+ ],
60339
+ homepage: "https://github.com/css/csso",
60340
+ keywords: [
60341
+ "css",
60342
+ "compress",
60343
+ "minifier",
60344
+ "minify",
60345
+ "optimise",
60346
+ "optimisation",
60347
+ "csstree"
60348
+ ],
60349
+ license: "MIT",
60350
+ main: "./lib/index",
60351
+ maintainers: [
60352
+ {
60353
+ name: "Roman Dvornov",
60354
+ email: "rdvornov@gmail.com"
60355
+ }
60356
+ ],
60357
+ name: "csso",
60358
+ repository: {
60359
+ type: "git",
60360
+ url: "git+https://github.com/css/csso.git"
60361
+ },
60362
+ scripts: {
60363
+ build: "rollup --config && terser dist/csso.js --compress --mangle -o dist/csso.min.js",
60364
+ coverage: "nyc npm test",
60365
+ coveralls: "nyc report --reporter=text-lcov | coveralls",
60366
+ hydrogen: "node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm --trace_hydrogen_file=code.cfg --print-opt-code bin/csso --stat -o /dev/null",
60367
+ lint: "eslint lib test",
60368
+ "lint-and-test": "npm run lint && npm test",
60369
+ prepublishOnly: "npm run build",
60370
+ test: "mocha --reporter dot",
60371
+ travis: "nyc npm run lint-and-test && npm run coveralls"
60372
+ },
60373
+ version: "4.2.0"
60298
60374
  };
60299
60375
  }
60300
60376
  });
@@ -328,6 +328,26 @@ export async function createProcessor(args, cliConfigPath) {
328
328
 
329
329
  return readInput()
330
330
  .then((css) => processor.process(css, { ...postcssOptions, from: input, to: output }))
331
+ .then((result) => {
332
+ if (!state.watcher) {
333
+ return result
334
+ }
335
+
336
+ env.DEBUG && console.time('Recording PostCSS dependencies')
337
+ for (let message of result.messages) {
338
+ if (message.type === 'dependency') {
339
+ state.contextDependencies.add(message.file)
340
+ }
341
+ }
342
+ env.DEBUG && console.timeEnd('Recording PostCSS dependencies')
343
+
344
+ // TODO: This needs to be in a different spot
345
+ env.DEBUG && console.time('Watch new files')
346
+ state.watcher.refreshWatchedFiles()
347
+ env.DEBUG && console.timeEnd('Watch new files')
348
+
349
+ return result
350
+ })
331
351
  .then((result) => {
332
352
  if (!output) {
333
353
  process.stdout.write(result.css)
@@ -62,7 +62,7 @@ export function createWatcher(args, { state, rebuild }) {
62
62
  extension: path.extname(file).slice(1),
63
63
  })
64
64
 
65
- chain = chain.then(() => rebuild(changedContent))
65
+ chain = chain.then(() => rebuild(changedContent.splice(0)))
66
66
 
67
67
  return chain
68
68
  }
@@ -233,14 +233,20 @@ export function coerceValue(types, modifier, options, tailwindConfig) {
233
233
  export function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
234
234
  let modifiersEnabled = flagEnabled(tailwindConfig, 'generalizedModifiers')
235
235
 
236
+ let [modifier, utilityModifier] = splitUtilityModifier(rawModifier)
237
+
236
238
  let canUseUtilityModifier =
237
239
  modifiersEnabled &&
238
240
  options.modifiers != null &&
239
- (options.modifiers === 'any' || typeof options.modifiers === 'object')
240
-
241
- let [modifier, utilityModifier] = canUseUtilityModifier
242
- ? splitUtilityModifier(rawModifier)
243
- : [rawModifier, undefined]
241
+ (options.modifiers === 'any' ||
242
+ (typeof options.modifiers === 'object' &&
243
+ ((utilityModifier && isArbitraryValue(utilityModifier)) ||
244
+ utilityModifier in options.modifiers)))
245
+
246
+ if (!canUseUtilityModifier) {
247
+ modifier = rawModifier
248
+ utilityModifier = undefined
249
+ }
244
250
 
245
251
  if (utilityModifier !== undefined && modifier === '') {
246
252
  modifier = 'DEFAULT'
@@ -11,6 +11,7 @@ module.exports = {
11
11
  xl: '1280px',
12
12
  '2xl': '1536px',
13
13
  },
14
+ supports: {},
14
15
  colors: ({ colors }) => ({
15
16
  inherit: colors.inherit,
16
17
  current: colors.current,
package/types/config.d.ts CHANGED
@@ -84,6 +84,7 @@ type ScreensConfig = string[] | KeyValuePair<string, string | Screen | Screen[]>
84
84
  interface ThemeConfig {
85
85
  // Responsiveness
86
86
  screens: ResolvableTo<ScreensConfig>
87
+ supports: ResolvableTo<Record<string, string>>
87
88
 
88
89
  // Reusable base configs
89
90
  colors: ResolvableTo<RecursiveKeyValuePair>
package/peers/.DS_Store DELETED
Binary file
package/peers/.svgo.yml DELETED
@@ -1,75 +0,0 @@
1
- # replace default config
2
-
3
- # multipass: true
4
- # full: true
5
-
6
- plugins:
7
-
8
- # - name
9
- #
10
- # or:
11
- # - name: false
12
- # - name: true
13
- #
14
- # or:
15
- # - name:
16
- # param1: 1
17
- # param2: 2
18
-
19
- - removeDoctype
20
- - removeXMLProcInst
21
- - removeComments
22
- - removeMetadata
23
- - removeXMLNS
24
- - removeEditorsNSData
25
- - cleanupAttrs
26
- - inlineStyles
27
- - minifyStyles
28
- - convertStyleToAttrs
29
- - cleanupIDs
30
- - prefixIds
31
- - removeRasterImages
32
- - removeUselessDefs
33
- - cleanupNumericValues
34
- - cleanupListOfValues
35
- - convertColors
36
- - removeUnknownsAndDefaults
37
- - removeNonInheritableGroupAttrs
38
- - removeUselessStrokeAndFill
39
- - removeViewBox
40
- - cleanupEnableBackground
41
- - removeHiddenElems
42
- - removeEmptyText
43
- - convertShapeToPath
44
- - convertEllipseToCircle
45
- - moveElemsAttrsToGroup
46
- - moveGroupAttrsToElems
47
- - collapseGroups
48
- - convertPathData
49
- - convertTransform
50
- - removeEmptyAttrs
51
- - removeEmptyContainers
52
- - mergePaths
53
- - removeUnusedNS
54
- - sortAttrs
55
- - sortDefsChildren
56
- - removeTitle
57
- - removeDesc
58
- - removeDimensions
59
- - removeAttrs
60
- - removeAttributesBySelector
61
- - removeElementsByAttr
62
- - addClassesToSVGElement
63
- - removeStyleElement
64
- - removeScriptElement
65
- - addAttributesToSVGElement
66
- - removeOffCanvasPaths
67
- - reusePaths
68
-
69
- # configure the indent (default 4 spaces) used by `--pretty` here:
70
- #
71
- # @see https://github.com/svg/svgo/blob/master/lib/svgo/js2svg.js#L6 for more config options
72
- #
73
- # js2svg:
74
- # pretty: true
75
- # indent: ' '