Skip to content

Commit

Permalink
fix(preset-mini): align with selection (#3771)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyv committed May 8, 2024
1 parent 54e08c0 commit 18df52c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/preset-mini/src/_variants/pseudo.ts
Expand Up @@ -69,7 +69,7 @@ const PseudoClasses: Record<string, string> = Object.fromEntries([
['placeholder', '::placeholder'],
['before', '::before'],
['after', '::after'],
['selection', '::selection'],
['selection', ' ::selection'],
['marker', ' ::marker'],
['file', '::file-selector-button'],
].map(key => Array.isArray(key) ? key : [key, `:${key}`]))
Expand Down
2 changes: 1 addition & 1 deletion packages/preset-wind/src/postprocessors/important.ts
Expand Up @@ -11,7 +11,7 @@ export function important(option: PresetWindOptions['important']): Postprocessor

// handle pseudo
if (selector.includes('::'))
return selector.replace(/(.*)(::.*)/, ':is($1)$2')
return selector.replace(/(.*?)(\s*::.*)/, ':is($1)$2')

return `:is(${selector})`
}
Expand Down
2 changes: 1 addition & 1 deletion test/assets/output/preset-mini-targets.css
Expand Up @@ -452,7 +452,7 @@ unocss .scope-\[unocss\]\:block{display:block;}
.out-of-range\:color-pink-100:out-of-range{--un-text-opacity:1;color:rgb(252 231 243 / var(--un-text-opacity));}
.placeholder-color-red-1::placeholder{--un-text-opacity:1;color:rgb(254 226 226 / var(--un-text-opacity));}
.placeholder\:color-transparent::placeholder{color:transparent;}
.selection\:color-\[var\(--select-color\)\]::selection{color:var(--select-color);}
.selection\:color-\[var\(--select-color\)\] ::selection{color:var(--select-color);}
.color-inherit,
.text-inherit{color:inherit;}
.color-initial{color:initial;}
Expand Down
2 changes: 1 addition & 1 deletion test/assets/output/preset-wind-important-string.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 18df52c

Please sign in to comment.