Skip to content

Tailwind not seeing classes in Leptos class: attributes #18092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mondeja opened this issue May 20, 2025 · 0 comments · May be fixed by #18093
Open

Tailwind not seeing classes in Leptos class: attributes #18092

mondeja opened this issue May 20, 2025 · 0 comments · May be fixed by #18093

Comments

@mondeja
Copy link

mondeja commented May 20, 2025

What version of Tailwind CSS are you using?

v4.1.7

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

@tailwindcss/cli

What version of Node.js are you using?

v22.9.0

What browser are you using?

None

What operating system are you using?

Linux

Reproduction URL

https://play.tailwindcss.com/86oxfAOKhi

Describe your issue

The rustacean framework Leptos has a view! macro that parses HTML-like code to generate components. It accepts the following syntax:

view! { <div class:px-0=true>Whatever</div> }

In Tailwind v3, you can add the next content.transform configuration in tailwind.config.js file to be able to support this syntax:

module.exports = {
  content: {
    files: ["*.html", "./src/**/*.rs"],
    transform: {
      rs: (content) => content.replace(/(?:^|\s)class:/g, ' '),
    },
  },
}

But Tailwind v4 does not support custom transformers.

@mondeja mondeja linked a pull request May 20, 2025 that will close this issue
@mondeja mondeja changed the title Tailwind not seeing classes in Leptos view! class: attributes Tailwind not seeing classes in Leptos class: attributes May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant