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

Alpha-less colors #3963

Closed
ayrton opened this issue Mar 31, 2021 · 5 comments · Fixed by #3984 · May be fixed by tailwindlabs/tailwindcss-jit#196
Closed

Alpha-less colors #3963

ayrton opened this issue Mar 31, 2021 · 5 comments · Fixed by #3984 · May be fixed by tailwindlabs/tailwindcss-jit#196

Comments

@ayrton
Copy link
Contributor

ayrton commented Mar 31, 2021

What version of @tailwindcss/jit are you using?

0.1.18

What version of Node.js are you using?

14.x

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

postcss@^8.2.0

What browser are you using?

N/A

What operating system are you using?

macOS

Reproduction repository

N/A

When certain core plugins have been disabled (eg. backgroundOpacity) tailwind-jit does not output alpha-less colors like tailwind does.

Is this is an intended breaking change or missing functionality? Happy to contribute if there is interest in supporting this use case.

Implementation difference:
tailwind-jit vs. tailwind

Example

With the following config:

module.exports = {
  corePlugins: {
    backgroundOpacity: false,
  },
}

Outcome:

.bg-gray-100{
	--tw-bg-opacity: 1;
	background-color: rgba(243, 244, 246, var(--tw-bg-opacity));
}

Expected outcome:

.bg-gray-100{
	background-color: #F3F4F6;
}
@ayrton
Copy link
Contributor Author

ayrton commented Mar 31, 2021

An example where this matters is css compilation for email/newsletter templates. As a temporary fix I've also disabled the backgroundColor core plugin and defined those selectors myself.

@adamwathan
Copy link
Member

Yeah I think we should support this if only because it makes the CSS output smaller for folks who don't need it. Would love a PR for it 👍🏻

@ayrton
Copy link
Contributor Author

ayrton commented Mar 31, 2021

Yeah I think we should support this if only because it makes the CSS output smaller for folks who don't need it. Would love a PR for it 👍🏻

Sweet. I'll take a stab at it

@ayrton
Copy link
Contributor Author

ayrton commented Apr 4, 2021

Opened PR in tailwindlabs/tailwindcss-jit#196

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

ayrton commented Apr 12, 2021

Re-opened PR in this repo after jit was merged in #3984

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.

2 participants