Skip to content

Commit

Permalink
Improve .btn-outline handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kidonng committed Mar 29, 2023
1 parent 0e249fa commit 28ab7b0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ export const presetDaisy = (

if (token.type === 'class') {
// Resolve conflicts with @unocss/preset-wind `link:` variant
base = token.name.startsWith('link-') ? 'link' : token.name
if (selector.startsWith('.link-')) base = 'link'
if (selector.startsWith('.btn-outline.btn-'))
base = (tokens[1] as ClassToken).name
base = token.name
} else if (token.type === 'pseudo-class' && token.name === 'where')
base = (tokenize(token.argument!)[0] as ClassToken).name
else if (['[dir="rtl"]', ':root'].includes(token.content))
Expand All @@ -89,7 +92,7 @@ export const presetDaisy = (
rules.set(base, (rules.get(base) ?? '') + String(rule) + '\n')
}

// Move `.btn-outline` after `btn-*`
// Move `.btn-outline` after `.btn-*`
const btnOutline = rules.get('btn-outline')!
rules.delete('btn-outline')
rules.set('btn-outline', btnOutline)
Expand Down

0 comments on commit 28ab7b0

Please sign in to comment.