Skip to content

🐛 has-[>svg]:px-2.5 not handled well by the tailwind parser #10368

@dyc3

Description

@dyc3

Environment information

Details
N/A

What happened?

found this while testing the new tailwind rules

packages/@midpay/ui/src/lib/components/ui/input-group/input-group-button.svelte:10:65 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ Expected a value but instead found '[>svg]:p-0'.

     8 │ 			xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
     9 │ 			sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
  > 10 │ 			"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
       │ 			                                                             ^^^^^^^^^^
    11 │ 			"icon-sm": "size-8 p-0 has-[>svg]:p-0",
    12 │ 		},

     8 │ 			xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
     9 │ 			sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
  > 10 │ 			"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
       │ 			                                                             ^^^^^^^^^^
    11 │ 			"icon-sm": "size-8 p-0 has-[>svg]:p-0",
    12 │ 		},

the bug is that has-[>svg]:px-2.5 is not being parsed correctly by the tailwind parser.

Expected result

The has-[>svg] variant should have its value parsed as a css selector. it is currently being parsed as a value. There may be other variants that have this distinction.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

Labels

A-ParserArea: parserL-TailwindLanguage: Tailwind CSSS-Bug-confirmedStatus: report has been confirmed as a valid bug

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions