Skip to content

Class not extracted when only occurrence is first element of Slim attribute array #17542

Closed
@markzalar

Description

@markzalar

What version of Tailwind CSS are you using?

v4.1.2

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

@tailwindcss/cli

What version of Node.js are you using?

v22.10.0

What browser are you using?

Chrome

What operating system are you using?

macOS 15

Reproduction URL

https://github.com/markzalar/tailwind-4.0.10-slim-first-in-array

Describe your issue

This issue started happening in tailwindcss 4.0.10

If the only occurrence of a class is the first element of a Slim attribute array, the class doesn't get extracted.

For example, if I have the following slim code

div[
  class=%w[bg-blue-500 w-10 h-10]
]
div[
  class=%w[w-10 bg-green-500 h-10]
]                

I would expect it to render as

Image

but if that's the only instance of bg-blue-500 in the codebase it doesn't get extracted and the slim snippet above renders as

Image

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