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

White Twice? #1768

Closed
neilchaudhuri opened this issue May 13, 2020 · 2 comments
Closed

White Twice? #1768

neilchaudhuri opened this issue May 13, 2020 · 2 comments

Comments

@neilchaudhuri
Copy link

Not sure if this is a bug or a feature, but I have found that adding the white utility causes white to be added twice to a style definition.

Given the following:

colors: {
      white: '#fff',
...
}

And

button {
    @apply border-none text-center text-white !important;
}

I find this:

button {
  border-style: none !important;
  text-align: center !important;
  --text-opacity: 1 !important;
  color: #fff !important;
  color: rgba(255, 255, 255, var(--text-opacity)) !important;
}

Is it right to have two color entries? Removing text-whitefrom the @apply call removes both.

Wanted to report this in case it is a bug.

@lihbr
Copy link
Contributor

lihbr commented May 14, 2020

It's not a bug as it's part of the text-opacity utility, the first color output is just meant to be used as a fallback for IE (as it doesn't support css variables). If you don't want to see this and if you're fine leaving the text-opacity utility you can target your build toward IE: #1635 or disable the text-opacity utility: https://tailwindcss.com/docs/text-opacity#disabling

@neilchaudhuri
Copy link
Author

Appreciate the clarification. Thanks.

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

2 participants