Skip to content

Defining classes using @layer components in a CSS file does not display suggestions in VS Code. #1570

@YaphetsJoker

Description

@YaphetsJoker

What version of VS Code are you using?

For example: v1.78.2

What version of Tailwind CSS IntelliSense are you using?

v0.14.29

What version of Tailwind CSS are you using?

v4

What package manager are you using?

pnpm

What operating system are you using?

macOS

Tailwind CSS Stylesheet (v4) or config file (v3)

@import 'tailwindcss';

@layer components {
  .btn-primary {
    border-radius: calc(infinity * 1px);
    background-color: var(--color-violet-500);
    padding-inline: --spacing(5);
    padding-block: --spacing(2);
    font-weight: var(--font-weight-semibold);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
    &:hover {
      @media (hover: hover) {
        background-color: var(--color-violet-700);
      }
    }
  }
}

VS Code settings

{
    "tailwindCSS.emmetCompletions": true,
    "tailwindCSS.includeLanguages": {
        "typescriptreact": "html",
        "vue": "html",
        "javascriptreact": "html",
        "rescript": "javascriptreact"
    },
}

Reproduction URL

A public GitHub repo that includes a minimal reproduction of the bug. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private/confidential, since we want a link to a separate, isolated reproduction anyways.

Describe your issue

Defining classes using @layer components in a CSS file does not display suggestions in VS Code.

Image Image

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