Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(preset-mini): keep unitOnlyRE same with tailwind (#3674)
- Loading branch information
1 parent
955764b
commit f532b3f
Showing
3 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
export const numberWithUnitRE = /^(-?\d*(?:\.\d+)?)(px|pt|pc|%|r?(?:em|ex|lh|cap|ch|ic)|(?:[sld]?v|cq)(?:[whib]|min|max)|in|cm|mm|rpx)?$/i | ||
export const numberRE = /^(-?\d*(?:\.\d+)?)$/i | ||
export const unitOnlyRE = /^(px)$/i | ||
export const unitOnlyRE = /^(px|[sld]?v[wh])$/i | ||
export const unitOnlyMap: Record<string, number> = { | ||
px: 1, | ||
vw: 100, | ||
vh: 100, | ||
svw: 100, | ||
svh: 100, | ||
dvw: 100, | ||
dvh: 100, | ||
lvh: 100, | ||
lvw: 100, | ||
} | ||
export const bracketTypeRe = /^\[(color|length|size|position|quoted|string):/i | ||
export const splitComma = /,(?![^()]*\))/g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters