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

Set -webkit-tap-highlight-color to transparent in Preflight #9050

Closed
wants to merge 1 commit into from
Closed

Set -webkit-tap-highlight-color to transparent in Preflight #9050

wants to merge 1 commit into from

Conversation

zepfietje
Copy link

This PR removes the highlight over a link while it's being tapped.

For many, the blue highlight over a link on mobile is unexpected and personally I disable it on every project. There's also some bigger projects I know of that set the highlight color to transparent. In my opinion it would be good to have this as a default in Preflight. I'm open to discussion though, if you think this is a bad idea.

For reference, this has been requested in several discussions here as well:

@mirzobedil
Copy link

Of course, this is very useful.

@adamwathan
Copy link
Member

Hey thanks for the PR! I did some looking around and it seems like people are somewhat divided on this in the web dev community:

necolas/normalize.css#23

If we add this by default, it will be difficult for the people who don't want it to bring back the browser default behavior, so going to say no to this for now.

If you want to add this for your own projects of course you can, just a line of CSS:

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  html {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  }
}

Thanks though!

@adamwathan adamwathan closed this Aug 8, 2022
@zepfietje
Copy link
Author

Thanks for diving in, @adamwathan!

I'm aware I can just add it to my own projects, but I thought it might have a place in Tailwind CSS by default.
However, I totally understand your consideration!

@Santhosh-Umapathi-Beautyze

I think the majority would want the tap highlight to be removed by default.

@LucasOe
Copy link

LucasOe commented Oct 29, 2023

It looks like this has been added in #12299.

@zepfietje
Copy link
Author

Yay, thanks for notifying here, @LucasOe!

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 this pull request may close these issues.

5 participants