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] Disabling opacity core plugins doesn't change output of color plugins #4071

Closed
cossssmin opened this issue Apr 14, 2021 · 6 comments
Closed

Comments

@cossssmin
Copy link
Contributor

What version of Tailwind CSS are you using?

v2.1.1

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

Maizzle v3.3.0

What version of Node.js are you using?

v14.15.1

What browser are you using?

Chrome

What operating system are you using?

Windows 10

Reproduction repository

https://github.com/maizzle/maizzle

Describe your issue

When enabling JIT, you cannot disable core plugins:

module.exports = {
  mode: 'jit',
  purge: [
    'src/**/*.*',
  ],
  corePlugins: {
    textOpacity: false,
  },
}
<div class="text-red-400">example</div>

Result:

.text-red-400 {
  --tw-text-opacity: 1;
  color: rgba(248, 113, 113, var(--tw-text-opacity));
}

Expected:

.text-red-400 {
  color: #f87171;
}

Note I've only tested with the opacity plugins.

@iangraf
Copy link

iangraf commented Apr 19, 2021

I have the same problem. I need to continue to support IE11, which does not support CSS variables. I am able to use Tailwind 2 with the opacity utils disabled (and avoiding a few other utils that use CSS variables), but cannot use JIT mode because there is currently no way to disable the opacity utils.

@adamwathan
Copy link
Member

Hey! You actually can disable core plugins, it's just that disabling textOpacity doesn't change the output of the textColor plugin like it does in the classic engine. The text-opacity-{x} utilities themselves are not generated though, so disabling core plugins does work.

Generally I am hesitant to make changes that in any way indicate we are attempting to support IE11 because we definitely don't and will not ever support it, but for this specific issue there is an open PR here which I plan to merge if only to reduce the file size:

#3984

You'll run into this same problem in other spots though, like even box-shadow won't work in IE11 because of our use of CSS custom properties and I just don't think I can personally prioritize making changes to make that work in IE11 when we explicitly don't support it.

@adamwathan adamwathan changed the title [JIT] Cannot disable core plugins [JIT] Disabling opacity core plugins doesn't change output of color plugins Apr 19, 2021
@iangraf
Copy link

iangraf commented Apr 19, 2021

Thank you Adam! This is exactly what I was hoping for. I understand that v2 does not support IE11, so I have no other expectations for workarounds for IE11.

@cossssmin
Copy link
Contributor Author

Thanks Adam, looking forward to that PR!

Right now I'm enabling JIT only locally so that production builds output HEX values that will work in HTML email. The box-shadow thing, I already solved with tailwindcss-box-shadow in case others need something like that 👍

@adamwathan
Copy link
Member

This is working as expected on master now, can check the canary build to test it out:

npm install -D tailwindcss@canary

Will be available proper in v2.2 👍🏻

@iangraf
Copy link

iangraf commented May 10, 2021

Thank you Adam! I'm using Vue CLI so I will need to wait for the proper release PostCSS 7 compat build to check it out.

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

No branches or pull requests

3 participants