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

Safari - Issue with colors and opacity #7887

Closed
florianbouvot opened this issue Mar 18, 2022 · 10 comments
Closed

Safari - Issue with colors and opacity #7887

florianbouvot opened this issue Mar 18, 2022 · 10 comments

Comments

@florianbouvot
Copy link
Contributor

What version of Tailwind CSS are you using?

v3.0.23

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

laravel-mix v6.0.43

What version of Node.js are you using?

v17.7.1

What browser are you using?

Safari 15.4

What operating system are you using?

macOS 12.3

Reproduction URL

https://play.tailwindcss.com/UpPKozphrC

Describe your issue

It's may be more a Safari bug than a Tailwind CSS bug.

I create a button with an opacity to 0.9 on hover and button are not visible: every colors (text, bg, ...) seems to switch to black with alpha to 0 on Safari 15.4 (macOS).

@adamwathan
Copy link
Member

Do you get the same problem when you just write regular CSS to do the same thing with no Tailwind at all? I tested on Safari Technology Preview and can't reproduce, but I haven't updated macOS to get 15.4 proper yet.

@florianbouvot
Copy link
Contributor Author

florianbouvot commented Mar 18, 2022

@adamwathan In the following video I make some test and I identify that the bug is linked to the use of several property together:

  • border-radius with a value greater than zero
  • border-color transprent
  • opacity use on hover

The bug is present with regular CSS in Tailwind CSS context but when I remove completely Tailwind CSS regular CSS works well so it seems to be related with Tailwind CSS.

I think next step is to look at Tailwind CSS base and reset 🕵️‍♂️

Enregistrement.de.l.ecran.2022-03-18.a.15.54.23.mov

Code use in this video : https://play.tailwindcss.com/6xKNJkzw5Y

PS: Removing base fix the issue but I don't know what cause this issue in base.

@Jxyme
Copy link

Jxyme commented Mar 18, 2022

Hi,

I am able to reproduce the issues mentioned by @florianbouvot.

I'm also witnessing some odd issues with border-radius, border-color and opacity, displayed here: uploaded to Imgur.

When updating macOS to 12.3 I immediately noticed issues with buttons that were using several properties together.

I did a few tests, gradually adding more properties and when inline-flex was added to the mix the issues occurred again.

I have included a playground link here which includes some examples for you: https://play.tailwindcss.com/3tMDZaFJg9.

The issues are also present on iOS 15.4 (I imagine iOS 15.4 = Safari 15.4 so it makes sense).

Hopefully the information provided helps - thank you in advance.

@thecrypticace
Copy link
Contributor

This looks like a Safari 15.4 regression. I just tested in 15.3 and it's working fine but in 15.4 it fails. Another thing to note is if you remove the opacity the button background shows up again. I don't see any open webkit bugs for this yet though.

@thecrypticace
Copy link
Contributor

thecrypticace commented Mar 18, 2022

Reduced test case:

<button style="
  background-color: red;
  border-radius: 0.375rem;
  opacity: 0.6;
  display: inline-flex;
  border-color: transparent;
">
  Not working
</button>

Remove any one of the properties below background color and the background appears.

@thecrypticace
Copy link
Contributor

Alright I opened a bug with webkit for this: https://bugs.webkit.org/show_bug.cgi?id=238088

@adamwathan
Copy link
Member

Going to close this as unfortunately not anything we can do about it — just a browser bug that affects everyone, regardless of if they are using Tailwind or writing CSS by hand. Hopefully something they will fix soon 🤞

@matheins
Copy link

We had the same issue with our buttons.
We solved that one by adding -webkit-appearance: none; to the buttons css. Hope this helps some of you!

@Jxyme
Copy link

Jxyme commented Jul 22, 2022

We had the same issue with our buttons.
We solved that one by adding -webkit-appearance: none; to the buttons css. Hope this helps some of you!

This issue was resolved in MacOS 12.5 and iOS 15.6 released a few days ago to the public.

@yoonsikp
Copy link

yoonsikp commented Jan 4, 2023

Had a similar bug but it was fixed by adding position: relative;

https://stackoverflow.com/questions/73047620/safari-box-shadow-bug

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

6 participants