Skip to content
Discussion options

You must be logged in to vote

Hi, @petecooper

This is expected behavior, not a bug. Tailwind's arbitrary-value parser treats \ as its own escape character when processing [...] syntax (the same mechanism used for _ to preserve literal underscores). A single \n gets its backslash consumed by Tailwind's parser before the value is emitted into the generated CSS, so the browser never sees a literal \n — hence the run-on text. Escaping it as \n gives Tailwind's parser one backslash to consume while still emitting a literal \n in the compiled CSS, which is why your second example works. This lines up with Tailwind's own docs recommending String.raw() in JSX for the same reason — backslashes inside arbitrary values are speci…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@petecooper
Comment options

Answer selected by petecooper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants