8000 fix(preset-mini, preset-wind4): 🐛 support `has-data-*` variants (#4760) · unocss/unocss@1b06cf4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1b06cf4

Browse files
authored
fix(preset-mini, preset-wind4): 🐛 support has-data-* variants (#4760)
1 parent c698cbe commit 1b06cf4

File tree

5 files changed

+7
-2
lines changed

5 files changed

+7
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ export const variantTaggedDataAttributes: Variant[] = [
4343
taggedData('peer'),
4444
taggedData('parent'),
4545
taggedData('previous'),
46+
taggedData('has'),
4647
]

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ export const variantTaggedDataAttributes: Variant<Theme>[] = [
4343
taggedData('peer'),
4444
taggedData('parent'),
4545
taggedData('previous'),
46+
taggedData('has'),
4647
]

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,8 @@ unocss .scope-\[unocss\]\:block{display:block;}
484484
.b-2,
485485
.border-size-2{border-width:2px;}
486486
.border{border-width:1px;}
487-
.border-4{border-width:4px;}
487+
.border-4,
488+
.has-data-\[state\=closed\]\:border-4:has([data-state=closed]){border-width:4px;}
488489
.border-x{border-left-width:1px;border-right-width:1px;}
489490
.border-b{border-bottom-width:1px;}
490491
.border-e-4{border-inline-end-width:4px;}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,8 @@
547547
.b-2,
548548
.border-size-2{border-width:2px;}
549549
.border{border-width:1px;}
550-
.border-4{border-width:4px;}
550+
.border-4,
551+
.has-data-\[state\=closed\]\:border-4:has([data-state=closed]){border-width:4px;}
551552
.border-x{border-inline-width:1px;}
552553
.border-b{border-bottom-width:1px;}
553554
.border-e-4{border-inline-end-width:4px;}

test/assets/preset-mini-targets.ts

Lines changed: 1 addition & 0 deletions
6242
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,7 @@ export const presetMiniTargets: string[] = [
12701270
'group-data-[state=open]:font-bold',
12711271
'group-data-[state=open]/named:font-medium',
12721272
'peer-data-[state=closed]:border-3',
1273+
'has-data-[state=closed]:border-4',
12731274

12741275
// variants - container parent
12751276
'@container',

0 commit comments

Comments
 (0)
0