Skip to content

Adding custom utilities that use :where() selector, generates empty CSS selector when used with a responsive prefix #9303

@saadeghi

Description

@saadeghi

What version of Tailwind CSS are you using?

3.1.8

Reproduction URL

https://play.tailwindcss.com/6lUxA2zYzo?file=config

Describe your issue

This works:

<div class="sm:make-it-red">
addUtilities({
  '.make-it-red': {
    backgroundColor: 'red',
  },
}),{
  variants: ["responsive"],
}

But this doesn't work:

<div class="sm:make-it-pink">
addUtilities({
  ':where(.make-it-pink)': {
    backgroundColor: 'hotpink',
  },
}),{
  variants: ["responsive"],
}

Expected CSS:

@media (min-width: 640px) {
  .sm\:make-it-red {
    background-color: red
  }

   :where(.sm\:make-it-pink){
    background-color: hotpink
  }
}

Generated CSS:

@media (min-width: 640px) {
  .sm\:make-it-red {
    background-color: red
  }

   {
    background-color: hotpink
  }
}

As you can see here it generates empty selector name.

I wonder if there's a way to make it work to have :where() selectors with responsive prefixes.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions