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

v4 alpha 0.28 breaks plugin (tailwindcss-animate) & weird behavior with new p3 color opacity #14732

Open
ajayvignesh01 opened this issue Oct 20, 2024 · 1 comment · May be fixed by #14747
Open
Assignees

Comments

@ajayvignesh01
Copy link

What version of Tailwind CSS are you using?

v4.0.0-alpha.28

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

postcss 8.4.47, Next.js 15.0.0-rc.1

What version of Node.js are you using?

v20.16.0

What browser are you using?

Chrome

What operating system are you using?

For example: macOS

Reproduction URL

https://github.com/ajayvignesh01/tailwind-v4.0.0-alpha.28-plugins

Describe your issue

The tailwindcss-animate plugin was working since plugin support landed a few weeks ago. But when I upgrade to alpha 0.28, it stops working. No errors are thrown, but animations that rendered with alpha 0.21 - 0.27 are now not rendering.

Another bug is from the introduction of p3 colors. If you hover over the primary button which has bg-primary hover:bg-primary/90, the hover color shows a hue of green for some reason.

Preview with alpha 0.27 - https://tailwind-v4-0-0-alpha-28-plugins-gjaplla02.vercel.app/
Preview with alpha 0.28 - https://tailwind-v4-0-0-alpha-28-plugins-4pzuz8jxf.vercel.app/

@thecrypticace
Copy link
Contributor

thecrypticace commented Oct 20, 2024

Dropping some notes for me to look at tomorrow:

Regarding the colors:

  • This is only an issue in Chrome, FF and Safari are fine
  • The trigger requires an oklch/okblab color with a none component. Replacing it with a 0 fixes the issue.
  • Changing the color space of the color-mix also fixes the issue (but should not be necessary)
button {
  /* broken */
  background-color: color-mix(in srgb, oklch(0.985 0 none) 95%, transparent);

  /* works */
  background-color: color-mix(in srgb, oklch(0.985 0 0) 95%, transparent);
  background-color: color-mix(in oklch, oklch(0.985 0 none) 95%, transparent);
  background-color: color-mix(in oklab, oklch(0.985 0 none) 95%, transparent);
}

I think what's happening is that it gets converted into color(srgb …) internally, carries over the none component, and replaces the none at the end with 0 — instead of doing it before the conversion. Based on the following observations:

button {
  /* this is yellow */
  background-color: color-mix(in srgb, color(srgb 1.0 1.0 none) 95%, transparent);

  /* as is this */
  background-color: color-mix(in srgb, color(srgb 1.0 1.0 0) 95%, transparent);
  
  /* window.getComputedStyle($0)["background-color"] produces a color(srgb …) value */
  background-color: color-mix(in srgb, oklch(0.985 0 none) 95%, transparent);
}

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