Skip to content

"Circular dependency detected" error on using @apply in custom class #6386

@dcastil

Description

@dcastil

What version of Tailwind CSS are you using?

v3.0.1

What build tool (or framework if it abstracts the build tool) are you using?

Tailwind Playground

What version of Node.js are you using?

Not applicable

What browser are you using?

Chrome Version 96.0.4664.55

What operating system are you using?

macOS 12.0.1

Reproduction URL

https://play.tailwindcss.com/oslkj6dpmz?file=css

Only change was adding this CSS

.group-inner:focus-within .group-inner-focus-within\:sr-only {
    @apply sr-only;
}

Describe your issue

I'm getting a compilation error "<css input>: Circular dependency detected when using: @apply sr-only". But I'd expect the project to run without issues. This class was used in Tailwind CSS v2 without any issues.

I also don't understand how the circular dependency could come up since I'm using a class name not available in Tailwind CSS: group-inner-focus-within:sr-only. The issue goes away when I remove the last character y from the class. Seems like Tailwind tries to evaluate the class as a Tailwind class despite the prefix not existing in Tailwind.

Metadata

Metadata

Assignees

No one assigned

    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