Skip to content

Commit

Permalink
fix(preset-mini): marker pesudo element (#3702)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 committed Apr 11, 2024
1 parent f4ca55c commit 0b4a901
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/postcss/src/apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { expandVariantGroup, notNull, regexScopePlaceholder } from '@unocss/core
type Writeable<T> = { -readonly [P in keyof T]: T[P] }

export async function parseApply(root: Root, uno: UnoGenerator, directiveName: string) {
const promises: Promise<unknown>[] = [];
const promises: Promise<unknown>[] = []
root.walkAtRules(directiveName, (rule) => {
promises.push((async () => {
if (!rule.parent)
Expand Down Expand Up @@ -88,5 +88,5 @@ export async function parseApply(root: Root, uno: UnoGenerator, directiveName: s
rule.remove()
})())
})
await Promise.all(promises);
await Promise.all(promises)
}
2 changes: 1 addition & 1 deletion packages/preset-mini/src/_variants/pseudo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const PseudoClasses: Record<string, string> = Object.fromEntries([
['before', '::before'],
['after', '::after'],
['selection', '::selection'],
['marker', '::marker'],
['marker', ' ::marker'],
['file', '::file-selector-button'],
].map(key => Array.isArray(key) ? key : [key, `:${key}`]))

Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/order.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ exports[`order > multiple variant sorting 1`] = `

exports[`order > pseudo-elements sorting 1`] = `
"/* layer: default */
.dark .dark\\:hover\\:file\\:marker\\:bg-red-600::file-selector-button:hover::marker{--un-bg-opacity:1;background-color:rgb(220 38 38 / var(--un-bg-opacity));}
.dark .dark\\:file\\:marker\\:hover\\:bg-red-600:hover::file-selector-button::marker{--un-bg-opacity:1;background-color:rgb(220 38 38 / var(--un-bg-opacity));}"
.dark .dark\\:hover\\:file\\:marker\\:bg-red-600 ::marker::file-selector-button:hover{--un-bg-opacity:1;background-color:rgb(220 38 38 / var(--un-bg-opacity));}
.dark .dark\\:file\\:marker\\:hover\\:bg-red-600:hover ::marker::file-selector-button{--un-bg-opacity:1;background-color:rgb(220 38 38 / var(--un-bg-opacity));}"
`;

exports[`order > variant ordering 1`] = `
Expand Down
2 changes: 1 addition & 1 deletion test/assets/output/preset-mini-targets.css
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ unocss .scope-\[unocss\]\:block{display:block;}
.hover\:is-first\:checked\:bg-true-gray\/10:checked:is(:first-child):hover{background-color:rgb(163 163 163 / 0.1);}
.hover\:not-first\:checked\:bg-red\/10:checked:not(:first-child):hover{background-color:rgb(248 113 113 / 0.1);}
.hover\:not-first\:checked\:bg-true-gray\/10:checked:not(:first-child):hover{background-color:rgb(163 163 163 / 0.1);}
.marker\:bg-violet-200::marker{--un-bg-opacity:1;background-color:rgb(221 214 254 / var(--un-bg-opacity));}
.marker\:bg-violet-200 ::marker{--un-bg-opacity:1;background-color:rgb(221 214 254 / var(--un-bg-opacity));}
.file\:bg-violet-50::file-selector-button{--un-bg-opacity:1;background-color:rgb(245 243 255 / var(--un-bg-opacity));}
.bg-opacity-\[--opacity-variable\],
.bg-opacity-\$opacity-variable{--un-bg-opacity:var(--opacity-variable);}
Expand Down

0 comments on commit 0b4a901

Please sign in to comment.