From 90e2b0110941a3d553a2997c45df6345af171190 Mon Sep 17 00:00:00 2001 From: Dany Castillo <31006608+dcastil@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:39:21 +0200 Subject: [PATCH] don't validate arbitrary value of opacity and other similar classes We don't need to check arbitrary values since there are no conflcits with other classes --- src/lib/default-config.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/default-config.ts b/src/lib/default-config.ts index 9e5df6c..34834ef 100644 --- a/src/lib/default-config.ts +++ b/src/lib/default-config.ts @@ -86,7 +86,6 @@ export const getDefaultConfig = () => { const getZeroAndEmpty = () => ['', '0', isArbitraryValue] as const const getBreaks = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'] as const - const getNumber = () => [isNumber, isArbitraryNumber] const getNumberAndArbitrary = () => [isNumber, isArbitraryValue] return { @@ -96,12 +95,12 @@ export const getDefaultConfig = () => { colors: [isAny], spacing: [isLength, isArbitraryLength], blur: ['none', '', isTshirtSize, isArbitraryValue], - brightness: getNumber(), + brightness: getNumberAndArbitrary(), borderColor: [colors], borderRadius: ['none', '', 'full', isTshirtSize, isArbitraryValue], borderSpacing: getSpacingWithArbitrary(), borderWidth: getLengthWithEmptyAndArbitrary(), - contrast: getNumber(), + contrast: getNumberAndArbitrary(), grayscale: getZeroAndEmpty(), hueRotate: getNumberAndArbitrary(), invert: getZeroAndEmpty(), @@ -110,10 +109,10 @@ export const getDefaultConfig = () => { gradientColorStopPositions: [isPercent, isArbitraryLength], inset: getSpacingWithAutoAndArbitrary(), margin: getSpacingWithAutoAndArbitrary(), - opacity: getNumber(), + opacity: getNumberAndArbitrary(), padding: getSpacingWithArbitrary(), - saturate: getNumber(), - scale: getNumber(), + saturate: getNumberAndArbitrary(), + scale: getNumberAndArbitrary(), sepia: getZeroAndEmpty(), skew: getNumberAndArbitrary(), space: getSpacingWithArbitrary(),