Skip to content
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

JIT ignores Svelte class:directives #3975

Closed
kkarpeev opened this issue Apr 5, 2021 · 4 comments
Closed

JIT ignores Svelte class:directives #3975

kkarpeev opened this issue Apr 5, 2021 · 4 comments
Labels

Comments

@kkarpeev
Copy link

kkarpeev commented Apr 5, 2021

What version of @tailwindcss/jit are you using?

0.1.18

What version of Node.js are you using?

12.18.1

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

webpack 5, postcss 8, tailwindcss 2.0.4

What browser are you using?

all of them, doesn't matter

What operating system are you using?

doesn't matter (windows, wsl, linux)

Reproduction repository

https://github.com/kkarpeev/svelte-tailwind-template

Hello. JIT skips classes specified in a class: directives in .svelte or html files. Svelte is a top-6 js framework in 2020 (according to some TOPs).
Please, add support for this directive asap.

See this small description (and that's all):

If you try the repo (thanks to @non25) you'll see that jit ignores class:w-4={!active}. This class appears on <button... element in this example.
There are two variants for using this directive:

  1. class:whatever-class-name123_
  2. class:whatever-class-name123_={some_boolean_expression}

Thank you in advance!

@adamwathan adamwathan transferred this issue from tailwindlabs/tailwindcss-jit Apr 5, 2021
@adamwathan adamwathan added the jit label Apr 5, 2021
@Adamatt
Copy link

Adamatt commented Apr 9, 2021

Try to update your Tailwindcss package to the latest version. This issue was already fixed by this PR #tailwindlabs/tailwindcss-jit#183 and tailwindcss-jit has been merged with the core package

Otherwise, you have to change the default extractor as described here #tailwindlabs/tailwindcss-jit#71 (comment)

@bradlc
Copy link
Contributor

bradlc commented Apr 30, 2021

Should work fine now without a custom extractor 👍

@bradlc bradlc closed this as completed Apr 30, 2021
@bcharbonnier
Copy link

@bradlc Sorry to comment on closed issue, but is there something special to do to have it working ?

I am using latest version v2.1.2 using default configuration, with just mode: 'jit' and it is still not recognizing the svelte class:directive pattern.
I still have to use the above trick from tailwindlabs/tailwindcss-jit#71 (comment)

@denovodavid
Copy link

denovodavid commented May 15, 2021

@bcharbonnier There is an additional fix from #4187 that hasn't been released yet. I'm still using a custom default extractor for it to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants