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:
- Replaces unescaped
_ with spaces
- Preserves
\_ as literal _
- Is called by all arbitrary handlers
Related
Sub-concern of #20.
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)Expected fix
A shared utility (e.g.
fn decode_arbitrary_value(s: &str) -> String) that:_with spaces\_as literal_Related
Sub-concern of #20.