Improve [0] arbitrary value support (#6259)

* test `text-[0]` instead of `w-[0]`

* update changelog
This commit is contained in:
Robin Malfait 2021-12-03 19:23:01 +01:00 • committed by GitHub
parent 078186a1ef
commit ea139f20a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 2 deletions

View file

@ -81,7 +81,7 @@ let lengthUnits = [
let lengthUnitsPattern = `(?:${lengthUnits.join('|')})`
export function length(value) {
return (
value === 0 ||
value === '0' ||
new RegExp(`${lengthUnitsPattern}$`).test(value) ||
cssFunctions.some((fn) => new RegExp(`^${fn}\\(.+?${lengthUnitsPattern}`).test(value))
)