Skip to content

Commit

Permalink
don't validate arbitrary value of opacity and other similar classes
Browse files Browse the repository at this point in the history
We don't need to check arbitrary values since there are no conflcits with other classes
  • Loading branch information
dcastil committed Jul 29, 2024
1 parent 99c2eba commit 90e2b01
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/lib/default-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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(),
Expand All @@ -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(),
Expand Down

0 comments on commit 90e2b01

Please sign in to comment.