diff --git a/packages/tailwindcss-patch/src/core/patches/supportCustomUnits/index.ts b/packages/tailwindcss-patch/src/core/patches/supportCustomUnits/index.ts index ced778b5..28a43afc 100644 --- a/packages/tailwindcss-patch/src/core/patches/supportCustomUnits/index.ts +++ b/packages/tailwindcss-patch/src/core/patches/supportCustomUnits/index.ts @@ -49,7 +49,7 @@ function findAstNode(content: string, options: ILengthUnitsPatchOptions) { } } -export function monkeyPatchForSupportingCustomUnit(rootDir: string, options?: ILengthUnitsPatchOptions) { +export function monkeyPatchForSupportingCustomUnit(rootDir: string, options?: Partial) { const opts = defu, ILengthUnitsPatchOptions[]>(options, { units: ['rpx'], lengthUnitsFilePath: 'lib/util/dataTypes.js', diff --git a/packages/tailwindcss-patch/src/core/runtime-patcher.ts b/packages/tailwindcss-patch/src/core/runtime-patcher.ts index 1bd74c0b..5281a72b 100644 --- a/packages/tailwindcss-patch/src/core/runtime-patcher.ts +++ b/packages/tailwindcss-patch/src/core/runtime-patcher.ts @@ -15,7 +15,9 @@ export function internalPatch(pkgJsonPath: string | undefined, options: Internal if (options.applyPatches?.extendLengthUnits) { try { - monkeyPatchForSupportingCustomUnit(twDir) + monkeyPatchForSupportingCustomUnit(twDir, { + overwrite: options.overwrite, + }) } catch { diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.0.0/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.0.0/lib/util/dataTypes.js index 9bed93ad..5fd5aa24 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.0.0/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.0.0/lib/util/dataTypes.js @@ -62,7 +62,24 @@ function percentage(value) { return /%$/g.test(value) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?%`).test(value) ); } -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'vw', 'vh', 'vmin', 'vmax', 'rpx']; +let lengthUnits = [ + 'cm', + 'mm', + 'Q', + 'in', + 'pc', + 'pt', + 'px', + 'em', + 'ex', + 'ch', + 'rem', + 'lh', + 'vw', + 'vh', + 'vmin', + 'vmax', +]; let lengthUnitsPattern = `(?:${lengthUnits.join('|')})`; function length(value) { return value.split(UNDERSCORE).every((part)=>{ diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.2.1/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.2.1/lib/util/dataTypes.js index 773e95ed..d04b2e39 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.2.1/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.2.1/lib/util/dataTypes.js @@ -70,7 +70,24 @@ function number(value) { function percentage(value) { return value.endsWith("%") && number(value.slice(0, -1)) || isCSSFunction(value); } -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'vw', 'vh', 'vmin', 'vmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "vw", + "vh", + "vmin", + "vmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.2.2/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.2.2/lib/util/dataTypes.js index 773e95ed..d04b2e39 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.2.2/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.2.2/lib/util/dataTypes.js @@ -70,7 +70,24 @@ function number(value) { function percentage(value) { return value.endsWith("%") && number(value.slice(0, -1)) || isCSSFunction(value); } -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'vw', 'vh', 'vmin', 'vmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "vw", + "vh", + "vmin", + "vmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.2.3/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.2.3/lib/util/dataTypes.js index 773e95ed..d04b2e39 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.2.3/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.2.3/lib/util/dataTypes.js @@ -70,7 +70,24 @@ function number(value) { function percentage(value) { return value.endsWith("%") && number(value.slice(0, -1)) || isCSSFunction(value); } -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'vw', 'vh', 'vmin', 'vmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "vw", + "vh", + "vmin", + "vmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.2.4/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.2.4/lib/util/dataTypes.js index 773e95ed..d04b2e39 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.2.4/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.2.4/lib/util/dataTypes.js @@ -70,7 +70,24 @@ function number(value) { function percentage(value) { return value.endsWith("%") && number(value.slice(0, -1)) || isCSSFunction(value); } -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'vw', 'vh', 'vmin', 'vmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "vw", + "vh", + "vmin", + "vmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.2.6/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.2.6/lib/util/dataTypes.js index 939b2fe2..4f13f25f 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.2.6/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.2.6/lib/util/dataTypes.js @@ -79,7 +79,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.2.7/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.2.7/lib/util/dataTypes.js index 939b2fe2..4f13f25f 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.2.7/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.2.7/lib/util/dataTypes.js @@ -79,7 +79,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.3.0/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.3.0/lib/util/dataTypes.js index 4c2d12bb..140d3ff5 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.3.0/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.3.0/lib/util/dataTypes.js @@ -82,7 +82,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.3.1/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.3.1/lib/util/dataTypes.js index 4c2d12bb..140d3ff5 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.3.1/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.3.1/lib/util/dataTypes.js @@ -82,7 +82,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.3.2/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.3.2/lib/util/dataTypes.js index cb61256a..bf5897d5 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.3.2/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.3.2/lib/util/dataTypes.js @@ -112,7 +112,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.3.3/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.3.3/lib/util/dataTypes.js index 9eb4b6af..48f0a242 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.3.3/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.3.3/lib/util/dataTypes.js @@ -119,7 +119,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.3.4/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.3.4/lib/util/dataTypes.js index 5ea7e581..bcfeecac 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.3.4/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.3.4/lib/util/dataTypes.js @@ -195,7 +195,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.3.5/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.3.5/lib/util/dataTypes.js index bcfbe4a8..1facc6cc 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.3.5/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.3.5/lib/util/dataTypes.js @@ -219,7 +219,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.3.6/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.3.6/lib/util/dataTypes.js index 4251c5f3..1302a9bd 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.3.6/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.3.6/lib/util/dataTypes.js @@ -220,7 +220,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.3.7/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.3.7/lib/util/dataTypes.js index 4251c5f3..1302a9bd 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.3.7/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.3.7/lib/util/dataTypes.js @@ -220,7 +220,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.4.0/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.4.0/lib/util/dataTypes.js index 4251c5f3..1302a9bd 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.4.0/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.4.0/lib/util/dataTypes.js @@ -220,7 +220,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.4.1/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.4.1/lib/util/dataTypes.js index 05fa9d1f..d6676de7 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.4.1/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.4.1/lib/util/dataTypes.js @@ -230,7 +230,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.4.2/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.4.2/lib/util/dataTypes.js index d22aeaeb..90b2877c 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.4.2/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.4.2/lib/util/dataTypes.js @@ -230,7 +230,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.4.3/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.4.3/lib/util/dataTypes.js index d22aeaeb..90b2877c 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.4.3/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.4.3/lib/util/dataTypes.js @@ -230,7 +230,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.4.4/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.4.4/lib/util/dataTypes.js index d22aeaeb..90b2877c 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.4.4/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.4.4/lib/util/dataTypes.js @@ -230,7 +230,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.4.5/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.4.5/lib/util/dataTypes.js index 7643dc8f..f16f0f19 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.4.5/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.4.5/lib/util/dataTypes.js @@ -236,7 +236,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/3.4.6/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/3.4.6/lib/util/dataTypes.js index 7643dc8f..f16f0f19 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/3.4.6/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/3.4.6/lib/util/dataTypes.js @@ -236,7 +236,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value); diff --git a/packages/tailwindcss-patch/test/fixtures/versions/lts/lib/util/dataTypes.js b/packages/tailwindcss-patch/test/fixtures/versions/lts/lib/util/dataTypes.js index 7643dc8f..f16f0f19 100644 --- a/packages/tailwindcss-patch/test/fixtures/versions/lts/lib/util/dataTypes.js +++ b/packages/tailwindcss-patch/test/fixtures/versions/lts/lib/util/dataTypes.js @@ -236,7 +236,39 @@ function percentage(value) { // Please refer to MDN when updating this list: // https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units -let lengthUnits = ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'rlh', 'vw', 'vh', 'vmin', 'vmax', 'vb', 'vi', 'svw', 'svh', 'lvw', 'lvh', 'dvw', 'dvh', 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax', 'rpx']; +let lengthUnits = [ + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + "em", + "ex", + "ch", + "rem", + "lh", + "rlh", + "vw", + "vh", + "vmin", + "vmax", + "vb", + "vi", + "svw", + "svh", + "lvw", + "lvh", + "dvw", + "dvh", + "cqw", + "cqh", + "cqi", + "cqb", + "cqmin", + "cqmax" +]; let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; function length(value) { return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value);