Skip to content

Arbitrary bracket values don't decode underscores to spaces #27

@goulvenclech

Description

@goulvenclech

In Tailwind CSS v4, _ inside bracket notation ([value]) is decoded to a space — e.g. grid-cols-[200px_1fr_2fr]grid-template-columns: 200px 1fr 2fr. Currently, all arbitrary handlers pass the captured value through raw, keeping underscores as-is.

Affected handlers

  • handle_arbitrary_color (color.rs)
  • handle_arbitrary_opacity (effects.rs)
  • handle_arbitrary_content (typography.rs)
  • All 8 grid arbitrary handlers (grid.rs)

Expected fix

A shared utility (e.g. fn decode_arbitrary_value(s: &str) -> String) that:

  1. Replaces unescaped _ with spaces
  2. Preserves \_ as literal _
  3. Is called by all arbitrary handlers

Related

Sub-concern of #20.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions