tailwindcss 0.0.0-insiders.bbf3a37 → 0.0.0-insiders.bc46d0e

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/CHANGELOG.md CHANGED
@@ -16,15 +16,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
16
  - Use local user CSS cache for `@apply` ([#7524](https://github.com/tailwindlabs/tailwindcss/pull/7524))
17
17
  - Invalidate context when main CSS changes ([#7626](https://github.com/tailwindlabs/tailwindcss/pull/7626))
18
18
  - Only add `!` to selector class matching template candidate when using important modifier with mutli-class selectors ([#7664](https://github.com/tailwindlabs/tailwindcss/pull/7664))
19
+ - Correctly parse and prefix animation names with dots ([#7163](https://github.com/tailwindlabs/tailwindcss/pull/7163))
20
+ - Fix extraction from template literal/function with array ([#7481](https://github.com/tailwindlabs/tailwindcss/pull/7481))
19
21
 
20
22
  ### Changed
21
23
 
22
24
  - Replace `chalk` with `picocolors` ([#6039](https://github.com/tailwindlabs/tailwindcss/pull/6039))
25
+ - Replace `cosmiconfig` with `lilconfig` ([#6039](https://github.com/tailwindlabs/tailwindcss/pull/6038))
23
26
 
24
27
  ### Added
25
28
 
26
29
  - Allow default ring color to be a function ([#7587](https://github.com/tailwindlabs/tailwindcss/pull/7587))
27
30
  - Add `rgb` and `hsl` color helpers for CSS variables ([#7665](https://github.com/tailwindlabs/tailwindcss/pull/7665))
31
+ - Support PostCSS `Document` nodes ([#7291](https://github.com/tailwindlabs/tailwindcss/pull/7291))
32
+ - Add `text-start` and `text-end` utilities ([#6656](https://github.com/tailwindlabs/tailwindcss/pull/6656))
33
+ - Support customizing class name when using `darkMode: 'class'` ([#5800](https://github.com/tailwindlabs/tailwindcss/pull/5800))
28
34
 
29
35
  ## [3.0.23] - 2022-02-16
30
36
 
package/lib/cli.js CHANGED
@@ -6,7 +6,7 @@ var _path = _interopRequireDefault(require("path"));
6
6
  var _arg = _interopRequireDefault(require("arg"));
7
7
  var _fs = _interopRequireDefault(require("fs"));
8
8
  var _postcssLoadConfig = _interopRequireDefault(require("postcss-load-config"));
9
- var _cosmiconfig = require("cosmiconfig");
9
+ var _lilconfig = require("lilconfig");
10
10
  var _plugins // Little bit scary, looking at private/internal API
11
11
  = _interopRequireDefault(require("postcss-load-config/src/plugins"));
12
12
  var _processTailwindFeatures = _interopRequireDefault(require("./processTailwindFeatures"));
@@ -368,8 +368,8 @@ async function build() {
368
368
  let customPostCssPath = typeof args['--postcss'] === 'string' ? args['--postcss'] : undefined;
369
369
  let { plugins: configPlugins } = customPostCssPath ? await (async ()=>{
370
370
  let file = _path.default.resolve(customPostCssPath);
371
- // Implementation, see: https://unpkg.com/browse/postcss-load-config@3.0.1/src/index.js
372
- let { config ={} } = await (0, _cosmiconfig).cosmiconfig('postcss').load(file);
371
+ // Implementation, see: https://unpkg.com/browse/postcss-load-config@3.1.0/src/index.js
372
+ let { config ={} } = await (0, _lilconfig).lilconfig('postcss').load(file);
373
373
  if (typeof config === 'function') {
374
374
  config = config();
375
375
  } else {
@@ -8,6 +8,7 @@ var path = _interopRequireWildcard(require("path"));
8
8
  var _postcss = _interopRequireDefault(require("postcss"));
9
9
  var _createUtilityPlugin = _interopRequireDefault(require("./util/createUtilityPlugin"));
10
10
  var _buildMediaQuery = _interopRequireDefault(require("./util/buildMediaQuery"));
11
+ var _escapeClassName = _interopRequireDefault(require("./util/escapeClassName"));
11
12
  var _parseAnimationValue = _interopRequireDefault(require("./util/parseAnimationValue"));
12
13
  var _flattenColorPalette = _interopRequireDefault(require("./util/flattenColorPalette"));
13
14
  var _withAlphaVariable = _interopRequireWildcard(require("./util/withAlphaVariable"));
@@ -209,7 +210,7 @@ let variantPlugins = {
209
210
  addVariant('motion-reduce', '@media (prefers-reduced-motion: reduce)');
210
211
  },
211
212
  darkVariants: ({ config , addVariant })=>{
212
- let mode = config('darkMode', 'media');
213
+ let [mode, className = '.dark'] = [].concat(config('darkMode', 'media'));
213
214
  if (mode === false) {
214
215
  mode = 'media';
215
216
  _log.default.warn('darkmode-false', [
@@ -219,7 +220,7 @@ let variantPlugins = {
219
220
  ]);
220
221
  }
221
222
  if (mode === 'class') {
222
- addVariant('dark', '.dark &');
223
+ addVariant('dark', `${className} &`);
223
224
  } else if (mode === 'media') {
224
225
  addVariant('dark', '@media (prefers-color-scheme: dark)');
225
226
  }
@@ -989,8 +990,8 @@ let corePlugins = {
989
990
  }
990
991
  });
991
992
  },
992
- animation: ({ matchUtilities , theme , prefix })=>{
993
- let prefixName = (name)=>prefix(`.${name}`).slice(1)
993
+ animation: ({ matchUtilities , theme , config })=>{
994
+ let prefixName = (name)=>`${config('prefix')}${(0, _escapeClassName).default(name)}`
994
995
  ;
995
996
  var ref;
996
997
  let keyframes = Object.fromEntries(Object.entries((ref = theme('keyframes')) !== null && ref !== void 0 ? ref : {}).map(([key, value])=>{
@@ -2531,6 +2532,12 @@ let corePlugins = {
2531
2532
  },
2532
2533
  '.text-justify': {
2533
2534
  'text-align': 'justify'
2535
+ },
2536
+ '.text-start': {
2537
+ 'text-align': 'start'
2538
+ },
2539
+ '.text-end': {
2540
+ 'text-align': 'end'
2534
2541
  }
2535
2542
  });
2536
2543
  },
package/lib/index.js CHANGED
@@ -17,7 +17,18 @@ module.exports = function tailwindcss(configOrPath) {
17
17
  return root;
18
18
  },
19
19
  function(root, result) {
20
- (0, _processTailwindFeatures).default((0, _setupTrackingContext).default(configOrPath))(root, result);
20
+ let context = (0, _setupTrackingContext).default(configOrPath);
21
+ if (root.type === 'document') {
22
+ let roots = root.nodes.filter((node)=>node.type === 'root'
23
+ );
24
+ for (const root1 of roots){
25
+ if (root1.type === 'root') {
26
+ (0, _processTailwindFeatures).default(context)(root1, result);
27
+ }
28
+ }
29
+ return;
30
+ }
31
+ (0, _processTailwindFeatures).default(context)(root, result);
21
32
  },
22
33
  _sharedState.env.DEBUG && function(root) {
23
34
  console.timeEnd('JIT TOTAL');
@@ -7,16 +7,16 @@ const PATTERNS = [
7
7
  /(?:\['([^'\s]+[^<>"'`\s:\\])')/.source,
8
8
  /(?:\["([^"\s]+[^<>"'`\s:\\])")/.source,
9
9
  /(?:\[`([^`\s]+[^<>"'`\s:\\])`)/.source,
10
- /([^<>"'`\s]*\[\w*'[^"`\s]*'?\])/.source,
11
- /([^<>"'`\s]*\[\w*"[^'`\s]*"?\])/.source,
10
+ /([^${(<>"'`\s]*\[\w*'[^"`\s]*'?\])/.source,
11
+ /([^${(<>"'`\s]*\[\w*"[^'`\s]*"?\])/.source,
12
12
  /([^<>"'`\s]*\[\w*\('[^"'`\s]*'\)\])/.source,
13
13
  /([^<>"'`\s]*\[\w*\("[^"'`\s]*"\)\])/.source,
14
14
  /([^<>"'`\s]*\[\w*\('[^"`\s]*'\)\])/.source,
15
15
  /([^<>"'`\s]*\[\w*\("[^'`\s]*"\)\])/.source,
16
16
  /([^<>"'`\s]*\[[^<>"'`\s]*\('[^"`\s]*'\)+\])/.source,
17
17
  /([^<>"'`\s]*\[[^<>"'`\s]*\("[^'`\s]*"\)+\])/.source,
18
- /([^<>"'`\s]*\['[^"'`\s]*'\])/.source,
19
- /([^<>"'`\s]*\["[^"'`\s]*"\])/.source,
18
+ /([^${(<>"'`\s]*\['[^"'`\s]*'\])/.source,
19
+ /([^${(<>"'`\s]*\["[^"'`\s]*"\])/.source,
20
20
  /([^<>"'`\s]*\[[^<>"'`\s]*:[^\]\s]*\])/.source,
21
21
  /([^<>"'`\s]*\[[^<>"'`\s]*:'[^"'`\s]*'\])/.source,
22
22
  /([^<>"'`\s]*\[[^<>"'`\s]*:"[^"'`\s]*"\])/.source,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "0.0.0-insiders.bbf3a37",
3
+ "version": "0.0.0-insiders.bc46d0e",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -45,8 +45,8 @@
45
45
  "autoprefixer": "^10.4.2",
46
46
  "cssnano": "^5.0.17",
47
47
  "esbuild": "^0.14.21",
48
- "eslint": "^8.8.0",
49
- "eslint-config-prettier": "^8.3.0",
48
+ "eslint": "^8.9.0",
49
+ "eslint-config-prettier": "^8.4.0",
50
50
  "eslint-plugin-prettier": "^4.0.0",
51
51
  "jest": "^27.5.1",
52
52
  "jest-diff": "^27.5.1",
@@ -63,13 +63,13 @@
63
63
  "arg": "^5.0.1",
64
64
  "chokidar": "^3.5.3",
65
65
  "color-name": "^1.1.4",
66
- "cosmiconfig": "^7.0.1",
67
66
  "detective": "^5.2.0",
68
67
  "didyoumean": "^1.2.2",
69
68
  "dlv": "^1.1.3",
70
69
  "fast-glob": "^3.2.11",
71
70
  "glob-parent": "^6.0.2",
72
71
  "is-glob": "^4.0.3",
72
+ "lilconfig": "^2.0.4",
73
73
  "normalize-path": "^3.0.0",
74
74
  "object-hash": "^3.0.0",
75
75
  "picocolors": "^1.0.0",
package/src/cli.js CHANGED
@@ -7,7 +7,7 @@ import path from 'path'
7
7
  import arg from 'arg'
8
8
  import fs from 'fs'
9
9
  import postcssrc from 'postcss-load-config'
10
- import { cosmiconfig } from 'cosmiconfig'
10
+ import { lilconfig } from 'lilconfig'
11
11
  import loadPlugins from 'postcss-load-config/src/plugins' // Little bit scary, looking at private/internal API
12
12
  import tailwind from './processTailwindFeatures'
13
13
  import resolveConfigInternal from '../resolveConfig'
@@ -397,8 +397,8 @@ async function build() {
397
397
  ? await (async () => {
398
398
  let file = path.resolve(customPostCssPath)
399
399
 
400
- // Implementation, see: https://unpkg.com/browse/postcss-load-config@3.0.1/src/index.js
401
- let { config = {} } = await cosmiconfig('postcss').load(file)
400
+ // Implementation, see: https://unpkg.com/browse/postcss-load-config@3.1.0/src/index.js
401
+ let { config = {} } = await lilconfig('postcss').load(file)
402
402
  if (typeof config === 'function') {
403
403
  config = config()
404
404
  } else {
@@ -3,6 +3,7 @@ import * as path from 'path'
3
3
  import postcss from 'postcss'
4
4
  import createUtilityPlugin from './util/createUtilityPlugin'
5
5
  import buildMediaQuery from './util/buildMediaQuery'
6
+ import escapeClassName from './util/escapeClassName'
6
7
  import parseAnimationValue from './util/parseAnimationValue'
7
8
  import flattenColorPalette from './util/flattenColorPalette'
8
9
  import withAlphaVariable, { withAlphaValue } from './util/withAlphaVariable'
@@ -171,7 +172,8 @@ export let variantPlugins = {
171
172
  },
172
173
 
173
174
  darkVariants: ({ config, addVariant }) => {
174
- let mode = config('darkMode', 'media')
175
+ let [mode, className = '.dark'] = [].concat(config('darkMode', 'media'))
176
+
175
177
  if (mode === false) {
176
178
  mode = 'media'
177
179
  log.warn('darkmode-false', [
@@ -182,7 +184,7 @@ export let variantPlugins = {
182
184
  }
183
185
 
184
186
  if (mode === 'class') {
185
- addVariant('dark', '.dark &')
187
+ addVariant('dark', `${className} &`)
186
188
  } else if (mode === 'media') {
187
189
  addVariant('dark', '@media (prefers-color-scheme: dark)')
188
190
  }
@@ -611,8 +613,8 @@ export let corePlugins = {
611
613
  })
612
614
  },
613
615
 
614
- animation: ({ matchUtilities, theme, prefix }) => {
615
- let prefixName = (name) => prefix(`.${name}`).slice(1)
616
+ animation: ({ matchUtilities, theme, config }) => {
617
+ let prefixName = (name) => `${config('prefix')}${escapeClassName(name)}`
616
618
  let keyframes = Object.fromEntries(
617
619
  Object.entries(theme('keyframes') ?? {}).map(([key, value]) => {
618
620
  return [key, { [`@keyframes ${prefixName(key)}`]: value }]
@@ -1522,6 +1524,8 @@ export let corePlugins = {
1522
1524
  '.text-center': { 'text-align': 'center' },
1523
1525
  '.text-right': { 'text-align': 'right' },
1524
1526
  '.text-justify': { 'text-align': 'justify' },
1527
+ '.text-start': { 'text-align': 'start' },
1528
+ '.text-end': { 'text-align': 'end' },
1525
1529
  })
1526
1530
  },
1527
1531
 
package/src/index.js CHANGED
@@ -13,7 +13,21 @@ module.exports = function tailwindcss(configOrPath) {
13
13
  return root
14
14
  },
15
15
  function (root, result) {
16
- processTailwindFeatures(setupTrackingContext(configOrPath))(root, result)
16
+ let context = setupTrackingContext(configOrPath)
17
+
18
+ if (root.type === 'document') {
19
+ let roots = root.nodes.filter((node) => node.type === 'root')
20
+
21
+ for (const root of roots) {
22
+ if (root.type === 'root') {
23
+ processTailwindFeatures(context)(root, result)
24
+ }
25
+ }
26
+
27
+ return
28
+ }
29
+
30
+ processTailwindFeatures(context)(root, result)
17
31
  },
18
32
  env.DEBUG &&
19
33
  function (root) {
@@ -2,16 +2,16 @@ const PATTERNS = [
2
2
  /(?:\['([^'\s]+[^<>"'`\s:\\])')/.source, // ['text-lg' -> text-lg
3
3
  /(?:\["([^"\s]+[^<>"'`\s:\\])")/.source, // ["text-lg" -> text-lg
4
4
  /(?:\[`([^`\s]+[^<>"'`\s:\\])`)/.source, // [`text-lg` -> text-lg
5
- /([^<>"'`\s]*\[\w*'[^"`\s]*'?\])/.source, // font-['some_font',sans-serif]
6
- /([^<>"'`\s]*\[\w*"[^'`\s]*"?\])/.source, // font-["some_font",sans-serif]
5
+ /([^${(<>"'`\s]*\[\w*'[^"`\s]*'?\])/.source, // font-['some_font',sans-serif]
6
+ /([^${(<>"'`\s]*\[\w*"[^'`\s]*"?\])/.source, // font-["some_font",sans-serif]
7
7
  /([^<>"'`\s]*\[\w*\('[^"'`\s]*'\)\])/.source, // bg-[url('...')]
8
8
  /([^<>"'`\s]*\[\w*\("[^"'`\s]*"\)\])/.source, // bg-[url("...")]
9
9
  /([^<>"'`\s]*\[\w*\('[^"`\s]*'\)\])/.source, // bg-[url('...'),url('...')]
10
10
  /([^<>"'`\s]*\[\w*\("[^'`\s]*"\)\])/.source, // bg-[url("..."),url("...")]
11
11
  /([^<>"'`\s]*\[[^<>"'`\s]*\('[^"`\s]*'\)+\])/.source, // h-[calc(100%-theme('spacing.1'))]
12
12
  /([^<>"'`\s]*\[[^<>"'`\s]*\("[^'`\s]*"\)+\])/.source, // h-[calc(100%-theme("spacing.1"))]
13
- /([^<>"'`\s]*\['[^"'`\s]*'\])/.source, // `content-['hello']` but not `content-['hello']']`
14
- /([^<>"'`\s]*\["[^"'`\s]*"\])/.source, // `content-["hello"]` but not `content-["hello"]"]`
13
+ /([^${(<>"'`\s]*\['[^"'`\s]*'\])/.source, // `content-['hello']` but not `content-['hello']']`
14
+ /([^${(<>"'`\s]*\["[^"'`\s]*"\])/.source, // `content-["hello"]` but not `content-["hello"]"]`
15
15
  /([^<>"'`\s]*\[[^<>"'`\s]*:[^\]\s]*\])/.source, // `[attr:value]`
16
16
  /([^<>"'`\s]*\[[^<>"'`\s]*:'[^"'`\s]*'\])/.source, // `[content:'hello']` but not `[content:"hello"]`
17
17
  /([^<>"'`\s]*\[[^<>"'`\s]*:"[^"'`\s]*"\])/.source, // `[content:"hello"]` but not `[content:'hello']`