-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Tailwind v4 is not seeing classes in slang templates #17851
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
Comments
Maybe if I do just need to change match extension {
"clj" | "cljs" | "cljc" => Clojure.process(content),
"cshtml" | "razor" => Razor.process(content),
"haml" => Haml.process(content),
"json" => Json.process(content),
"pug" => Pug.process(content),
"rb" | "erb" => Ruby.process(content),
"slim" => Slim.process(content),
"svelte" => Svelte.process(content),
"vue" => Vue.process(content),
_ => content.to_vec(),
} to match extension {
"clj" | "cljs" | "cljc" => Clojure.process(content),
"cshtml" | "razor" => Razor.process(content),
"haml" => Haml.process(content),
"json" => Json.process(content),
"pug" => Pug.process(content),
"rb" | "erb" => Ruby.process(content),
"slim" | "slang" => Slim.process(content),
"svelte" => Svelte.process(content),
"vue" => Vue.process(content),
_ => content.to_vec(),
} |
Nice, I just have no idea how to build this thing 😅 , Would be nice to have a way to tell tailwind that an extension is an alias to another one, so issue like that could be solved by configuration, not a patches. |
@hugopl Hey! Seems like you're on the right track there already, awesome! Did you do a |
I'm tryign to compile this without my patch but without success. On v4.1.5 tag I did:
Then got:
When I run the tests some of them fails with:
|
Try running $ rustup target add wasm32-wasip1-threads Before trying the commands again. |
@philipp-spiess trying to debug a similar issue, tried
Any ideas? 😀 |
@iliakan I think you might be missing a |
What version of Tailwind CSS are you using?
For example: v4.1.4
What build tool (or framework if it abstracts the build tool) are you using?
None, using tailwindcss cli from Archlinux AUR package.
What version of Node.js are you using?
None
What browser are you using?
Chromium, Firefox
What operating system are you using?
Linux
Reproduction URL
Basic tailwindcss
input.css
file:Basic
test.slang
file:Run
tailwindcss -i input.css -o style.css
and check that there will be no.z-10
CSS class there.The resulting style.css is:
If I change the slang template to
The result is ok, but I'm using slang to not have to declare classes this way.
Describe your issue
Maybe I'm the only one in the world using tailwind with slang templates, Slang is a template almost identical to slim written in Crystal.
Using the very same process used to extract CSS classes from slim templates will just work for slang templates, I'm creating this issue because nowadays I need to write my templates like
body class="min-h-screen"
instead of justbody.min-h-screen
.There was an issue for slim templates in the past, so I believe that just let this code also run to slang files (.slang extension) fixes that.
If I knew rust I would not even create this issue but just create a fork of tailwind and fix it on my fork just for myself since I know that the audience is really very little.
That being said, I understand if you guys don't want to fix that because no one uses slang templates, but if so can you guys just say where to tell tailwind to use the same slim/haml heuristics for files with .slang extension?
Thanks very much.
The text was updated successfully, but these errors were encountered: