Skip to content

Commit

Permalink
fix(preset-attributify): remove StringNumberComposition type for bett…
Browse files Browse the repository at this point in the history
…er perf (#3459)

Co-authored-by: Chris <1633711653@qq.com>
  • Loading branch information
zhiyuanzmj and zyyv committed Dec 27, 2023
1 parent a8d0006 commit f3b58ac
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions packages/preset-attributify/src/jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,6 @@ export type SpecialSingleWord =
| 'transform'
| 'filter'

export type StringNumberCompositionPrefix =
| 'op'
| 'opacity'
| 'fw'
| 'p'
| 'm'
| 'w'
| 'h'
| 'z'

/** Some words can be a complete unocss rule by compose a string and a number, such as op80, fw300, p2, p10px */
export type StringNumberComposition = `${StringNumberCompositionPrefix}${number}${'px' | ''}`

export type PseudoPrefix =
| 'active'
| 'before'
Expand Down Expand Up @@ -104,6 +91,7 @@ export type SeparateEnabled =
| 'filter'
| 'flex'
| 'font'
| 'fw'
| 'gap'
| 'gradient'
| 'grid'
Expand All @@ -113,6 +101,7 @@ export type SeparateEnabled =
| 'justify'
| 'list'
| 'm'
| 'op'
| 'opacity'
| 'order'
| 'outline'
Expand All @@ -133,7 +122,7 @@ export type SeparateEnabled =
| 'z'
| PseudoPrefix

export type BasicAttributes = StringNumberComposition | SpecialSingleWord | TwoStringsComposition | SeparateEnabled
export type BasicAttributes = SpecialSingleWord | TwoStringsComposition | SeparateEnabled

export type AttributifyNames<Prefix extends string = ''> =
| `${Prefix}${BasicAttributes}`
Expand Down

0 comments on commit f3b58ac

Please sign in to comment.