tailwindcss 0.0.0-insiders.e2d5f21 → 0.0.0-insiders.e6e24b8

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
@@ -14,7 +14,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
14
  ### Added
15
15
 
16
16
  - Add `placeholder` variant ([#6106](https://github.com/tailwindlabs/tailwindcss/pull/6106))
17
- - Add tuple syntax for configuring screens while guaranteeing order ([#5956](https://github.com/tailwindlabs/tailwindcss/pull/5956))
18
17
  - Add composable `touch-action` utilities ([#6115](https://github.com/tailwindlabs/tailwindcss/pull/6115))
19
18
  - Add support for "arbitrary properties" ([#6161](https://github.com/tailwindlabs/tailwindcss/pull/6161))
20
19
  - Add `portrait` and `landscape` variants ([#6046](https://github.com/tailwindlabs/tailwindcss/pull/6046))
@@ -22,8 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
22
21
  - Add `menu` reset to preflight ([#6213](https://github.com/tailwindlabs/tailwindcss/pull/6213))
23
22
  - Allow `0` as a valid `length` value ([#6233](https://github.com/tailwindlabs/tailwindcss/pull/6233), [#6259](https://github.com/tailwindlabs/tailwindcss/pull/6259))
24
23
  - Add CSS functions to data types ([#6258](https://github.com/tailwindlabs/tailwindcss/pull/6258))
25
- - Add CSS functions to data types ([#6258](https://github.com/tailwindlabs/tailwindcss/pull/6258))
26
24
  - Support negative values for `scale-*` utilities ([c48e629](https://github.com/tailwindlabs/tailwindcss/commit/c48e629955585ad18dadba9f470fda59cc448ab7))
25
+ - Improve `length` data type, by validating each value individually ([#6283](https://github.com/tailwindlabs/tailwindcss/pull/6283))
27
26
 
28
27
  ### Changed
29
28
 
@@ -82,8 +82,10 @@ let lengthUnits = [
82
82
  ];
83
83
  let lengthUnitsPattern = `(?:${lengthUnits.join('|')})`;
84
84
  function length(value) {
85
- return value === '0' || new RegExp(`${lengthUnitsPattern}$`).test(value) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?${lengthUnitsPattern}`).test(value)
86
- );
85
+ return value.split(UNDERSCORE).every((part)=>{
86
+ return part === '0' || new RegExp(`${lengthUnitsPattern}$`).test(part) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?${lengthUnitsPattern}`).test(part)
87
+ );
88
+ });
87
89
  }
88
90
  let lineWidths = new Set([
89
91
  'thin',
@@ -3,9 +3,12 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  exports.normalizeScreens = normalizeScreens;
6
- function normalizeScreens(screens) {
6
+ function normalizeScreens(screens, root = true) {
7
7
  if (Array.isArray(screens)) {
8
8
  return screens.map((screen)=>{
9
+ if (root && Array.isArray(screen)) {
10
+ throw new Error('The tuple syntax is not supported for `screens`.');
11
+ }
9
12
  if (typeof screen === 'string') {
10
13
  return {
11
14
  name: screen.toString(),
@@ -46,7 +49,7 @@ function normalizeScreens(screens) {
46
49
  });
47
50
  }
48
51
  return normalizeScreens(Object.entries(screens !== null && screens !== void 0 ? screens : {
49
- }));
52
+ }), false);
50
53
  }
51
54
  function resolveValue({ 'min-width': _minWidth , min =_minWidth , max , raw } = {
52
55
  }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "0.0.0-insiders.e2d5f21",
3
+ "version": "0.0.0-insiders.e6e24b8",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -54,8 +54,8 @@
54
54
  "eslint": "^8.2.0",
55
55
  "eslint-config-prettier": "^8.3.0",
56
56
  "eslint-plugin-prettier": "^4.0.0",
57
- "jest": "^27.3.1",
58
- "jest-diff": "^27.2.5",
57
+ "jest": "^27.4.3",
58
+ "jest-diff": "^27.4.2",
59
59
  "postcss": "^8.4.4",
60
60
  "postcss-cli": "^8.3.1",
61
61
  "prettier": "^2.5.0",
@@ -80,11 +80,13 @@ let lengthUnits = [
80
80
  ]
81
81
  let lengthUnitsPattern = `(?:${lengthUnits.join('|')})`
82
82
  export function length(value) {
83
- return (
84
- value === '0' ||
85
- new RegExp(`${lengthUnitsPattern}$`).test(value) ||
86
- cssFunctions.some((fn) => new RegExp(`^${fn}\\(.+?${lengthUnitsPattern}`).test(value))
87
- )
83
+ return value.split(UNDERSCORE).every((part) => {
84
+ return (
85
+ part === '0' ||
86
+ new RegExp(`${lengthUnitsPattern}$`).test(part) ||
87
+ cssFunctions.some((fn) => new RegExp(`^${fn}\\(.+?${lengthUnitsPattern}`).test(part))
88
+ )
89
+ })
88
90
  }
89
91
 
90
92
  let lineWidths = new Set(['thin', 'medium', 'thick'])
@@ -7,14 +7,17 @@
7
7
  * - { sm: '100px', md: '200px' } // Object with string values
8
8
  * - { sm: { min: '100px' }, md: { max: '100px' } } // Object with object values
9
9
  * - { sm: [{ min: '100px' }, { max: '200px' }] } // Object with object array (multiple values)
10
- * - [['sm', '100px'], ['md', '200px']] // Tuple object
11
10
  *
12
11
  * Output(s):
13
12
  * - [{ name: 'sm', values: [{ min: '100px', max: '200px' }] }] // List of objects, that contains multiple values
14
13
  */
15
- export function normalizeScreens(screens) {
14
+ export function normalizeScreens(screens, root = true) {
16
15
  if (Array.isArray(screens)) {
17
16
  return screens.map((screen) => {
17
+ if (root && Array.isArray(screen)) {
18
+ throw new Error('The tuple syntax is not supported for `screens`.')
19
+ }
20
+
18
21
  if (typeof screen === 'string') {
19
22
  return { name: screen.toString(), values: [{ min: screen, max: undefined }] }
20
23
  }
@@ -34,7 +37,7 @@ export function normalizeScreens(screens) {
34
37
  })
35
38
  }
36
39
 
37
- return normalizeScreens(Object.entries(screens ?? {}))
40
+ return normalizeScreens(Object.entries(screens ?? {}), false)
38
41
  }
39
42
 
40
43
  function resolveValue({ 'min-width': _minWidth, min = _minWidth, max, raw } = {}) {