Skip to content

Class directive breaks with token "/" for TailwindCSS width classes #4072

@jerriclynsjohn

Description

@jerriclynsjohn

Describe the bug
When using specific classes like "w-1/2", which is standard tailwind class, the svelte compiler throws an error "Expected >svelte(unexpected-token)"

I'm pretty sure it is because the compiler assumes token ">" after the token in question "/".

To Reproduce
Write any code with a class directive class:sm:w-1/2={!contact} in a Svelte+Tailwind project.

Expected behavior
Compiler should not assume that the closing ">" token to succeed token "/" in a string after the class directive.

Metadata

Metadata

Assignees

Labels

cssStuff related to Svelte's built-in CSS handling

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions