Skip to content

Classes are not detected in Ruby %w literals using angle brackets <> or custom delimiters #20386

Description

@yhatt

What version of Tailwind CSS are you using?

v4.3.3

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

@tailwindcss/cli 4.3.3, tailwindcss 4.3.3

What version of Node.js are you using?

v26.6.0

What browser are you using?

N/A

What operating system are you using?

macOS

Reproduction URL

https://github.com/yhatt/tailwind-ruby-percent-literal-bug

Describe your issue

Tailwind CSS 4.3.3 parses Ruby files and extracts class names from the string defined by percent literals %w(bg-red-400).

However, it fails to parse percent literals that contain angle brackets (%w<bg-red-400>) or a custom non-paired delimiter (%w|bg-red-400|).

https://docs.ruby-lang.org/en/master/syntax/literals_rdoc.html#percent-literals

PERCENT_LITERAL_WITH_BRACKETS       = %w[bg-red-400]
PERCENT_LITERAL_WITH_PARENTHESIS    = %w(bg-orange-400)
PERCENT_LITERAL_WITH_BRACES         = %w{bg-yellow-400}
PERCENT_LITERAL_WITH_ANGLE_BRACKETS = %w<bg-green-400>
PERCENT_LITERAL_WITH_PIPE           = %w|bg-blue-400|
PERCENT_LITERAL_WITH_COLON          = %w:bg-indigo-400:
Expected Actual
Expected Actual

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