Skip to content

Variants of @layer-provided utilities have incorrect source map locations #12464

Closed
@sapphi-red

Description

What version of Tailwind CSS are you using?

v3.3.5

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

postcss 8.4.31

What version of Node.js are you using?

v20.9.0

What browser are you using?

N/A

What operating system are you using?

Windows

Reproduction URL

https://stackblitz.com/edit/node-xsqtyh?file=index.js,package.json

Describe your issue

Without tailwind, running postcss (+ autoprefixer) on the following content outputs a warning with { line: 8, column: 5, endLine: 8, endColumn: 25 }. This is the position of color-adjust: exact; which I expect.

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer utilities {
  .foo {
    color-adjust: exact;
  }
}

But with tailwind, the position becomes { line: 1, column: 1, endLine: 11, endColumn: 2 }. This points the whole content. Also endLine: 11, endColumn: 2 is pointing the position out-of-bounds.
I expect tailwind to not to alter the warning position.

I found this while debugging vitejs/vite#15076.

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