Skip to content

Commit ee37028

Browse files
authored
fix(preset-mini, preset-wind4): mutiplePass for aria & data (#4608)
1 parent 7949897 commit ee37028

File tree

12 files changed

+43
-7
lines changed

12 files changed

+43
-7
lines changed

packages-integrations/inspector/client/auto-imports.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,6 @@ declare global {
297297
// for type re-export
298298
declare global {
299299
// @ts-ignore
300-
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
300+
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
301301
import('vue')
302302
}

packages-presets/preset-mini/src/_variants/aria.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const variantAria: VariantObject = {
1717
}
1818
}
1919
},
20+
multiPass: true,
2021
}
2122

2223
function taggedAria(tagName: string): Variant {

packages-presets/preset-mini/src/_variants/data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const variantDataAttribute: VariantObject = {
1717
}
1818
}
1919
},
20+
multiPass: true,
2021
}
2122

2223
function taggedData(tagName: string): Variant {

packages-presets/preset-wind4/src/variants/aria.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const variantAria: VariantObject<Theme> = {
1717
}
1818
}
1919
},
20+
multiPass: true,
2021
}
2122

2223
function taggedAria(tagName: string): Variant<Theme> {

packages-presets/preset-wind4/src/variants/data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const variantDataAttribute: VariantObject<Theme> = {
1717
}
1818
}
1919
},
20+
multiPass: true,
2021
}
2122

2223
function taggedData(tagName: string): Variant<Theme> {

playground/src/auto-imports.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ declare global {
350350
// for type re-export
351351
declare global {
352352
// @ts-ignore
353-
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
353+
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
354354
import('vue')
355355
// @ts-ignore
356356
export type { UseResizeOptions } from './composables/resize'

test/__snapshots__/postcss.test.ts.snap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@ exports[`postcss > @unocss 1`] = `
288288
.object-center-top,
289289
.object-ct{object-position:center top;}
290290
.dark .\\.dark\\:text-xl{font-size:1.25rem;line-height:1.75rem;}
291+
.aria-busy\\:aria-pressed\\:text-green-600[aria-pressed="true"][aria-busy="true"],
292+
.aria-busy\\:data-\\[bar\\]\\:text-green-600[data-bar][aria-busy="true"],
293+
.aria-busy\\:text-green-600[aria-busy="true"],
294+
.data-\\[foo\\=x\\]\\:data-\\[bar\\=y\\]\\:text-green-600[data-bar=y][data-foo=x],
295+
.data-\\[foo\\=x\\]\\:text-green-600[data-foo=x]{--un-text-opacity:1;color:rgb(22 163 74 / var(--un-text-opacity));}
291296
.capitalize{text-transform:capitalize;}
292297
.normal-case{text-transform:none;}
293298
.lining-nums{--un-numeric-figure:lining-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction);}

test/assets/output/preset-wind-targets.css

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/assets/output/preset-wind4-targets.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@
116116
--tracking-wide: 0.025em;
117117
--colors-blue-500: oklch(0.623 0.214 259.815);
118118
--colors-red-300: oklch(0.808 0.114 19.571);
119-
--colors-red-600: oklch(0.577 0.245 27.325);
120119
--colors-red-DEFAULT: oklch(0.704 0.191 22.216);
121120
--colors-black: #000;
122121
--colors-blue-DEFAULT: oklch(0.707 0.165 254.624);
@@ -127,6 +126,7 @@
127126
--colors-rose-DEFAULT: oklch(0.712 0.194 13.428);
128127
--fontWeight-thin: 100;
129128
--textStrokeWidth-sm: thin;
129+
--colors-red-600: oklch(0.577 0.245 27.325);
130130
--colors-green-600: oklch(0.627 0.194 149.214);
131131
--colors-red-400: oklch(0.704 0.191 22.216);
132132
--text-sm-fontSize: 0.875rem;
@@ -197,6 +197,11 @@
197197
.text-\[var\(--color\)\]{color:color-mix(in oklch, var(--color) var(--un-text-opacity), transparent) /* var(--color) */;}
198198
.text-\[theme\(spacing\.sm\)\]{color:color-mix(in oklch, calc(var(--spacing) * 3.5) var(--un-text-opacity), transparent) /* calc(var(--spacing) * 3.5) */;}
199199
.text-black\/10{--un-text-opacity:10%;color:color-mix(in oklch, var(--colors-black) var(--un-text-opacity), transparent) /* #000 */;}
200+
.aria-busy\:aria-pressed\:text-green-600[aria-pressed="true"][aria-busy="true"],
201+
.aria-busy\:data-\[bar\]\:text-green-600[data-bar][aria-busy="true"],
202+
.aria-busy\:text-green-600[aria-busy="true"],
203+
.data-\[foo\=x\]\:data-\[bar\=y\]\:text-green-600[data-bar=y][data-foo=x],
204+
.data-\[foo\=x\]\:text-green-600[data-foo=x]{color:color-mix(in oklch, var(--colors-green-600) var(--un-text-opacity), transparent) /* oklch(0.627 0.194 149.214) */;}
200205
.dark .dark\:not-odd\:text-red:not(:nth-child(odd)){color:color-mix(in oklch, var(--colors-red-DEFAULT) var(--un-text-opacity), transparent) /* oklch(0.704 0.191 22.216) */;}
201206
.text-red-100,
202207
.text-red100{color:color-mix(in oklch, var(--colors-red-100) var(--un-text-opacity), transparent) /* oklch(0.936 0.032 17.717) */;}

test/assets/preset-wind-targets.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,14 @@ export const presetWindTargets: string[] = [
402402

403403
// variants - aria (theme)
404404
'aria-hidden:hidden',
405+
'aria-busy:text-green-600',
406+
'aria-busy:aria-pressed:text-green-600',
407+
'aria-busy:data-[bar]:text-green-600',
405408

406409
// variants - data (theme)
407410
'data-dropdown:ring-green',
411+
'data-[foo=x]:text-green-600',
412+
'data-[foo=x]:data-[bar=y]:text-green-600',
408413

409414
// view-transition
410415
'view-transition-foo',

0 commit comments

Comments
 (0)