Skip to content

Commit

Permalink
change positionSensitiveModifiers to array
Browse files Browse the repository at this point in the history
  • Loading branch information
dcastil committed Jan 29, 2025
1 parent 3fe7d3e commit 5a0a737
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib/parse-class-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const createParseClassName = (config: AnyConfig) => {
return parseClassName
}

const positionSensitiveModifiers = new Set([
const positionSensitiveModifiers = [
'before',
'after',
'placeholder',
Expand All @@ -106,7 +106,7 @@ const positionSensitiveModifiers = new Set([
'backdrop',
'*',
'**',
])
]

/**
* Sorts modifiers according to following schema:
Expand All @@ -122,7 +122,8 @@ export const sortModifiers = (modifiers: string[]) => {
let unsortedModifiers: string[] = []

modifiers.forEach((modifier) => {
const isPositionSensitive = modifier[0] === '[' || positionSensitiveModifiers.has(modifier)
const isPositionSensitive =
modifier[0] === '[' || positionSensitiveModifiers.includes(modifier)

if (isPositionSensitive) {
sortedModifiers.push(...unsortedModifiers.sort(), modifier)
Expand Down

0 comments on commit 5a0a737

Please sign in to comment.