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

Revert including outline-color in transition and transition-colors by default #10604

Merged
merged 2 commits into from Feb 16, 2023

Conversation

reinink
Copy link
Member

@reinink reinink commented Feb 16, 2023

Resolves #10591

This PR reverts a change made in #10385 where we added outline-color to the transition and transition-colors utilities by default. Unfortunately this created a breaking change for people using focus:outline-none because our implementation of outline-none actually sets the outline-color to transparent instead of the outline-style to none for accessibility reasons related to Windows High Contrast Mode. This caused a black outline to momentarily appear on focus if you were using a transition or transition-colors utility on an element that also had focus:outline-none.

For anyone who does need outline-color to transition, you can extend your transitionProperty configuration to include outline-color in the DEFAULT and colors properties:

let defaultTheme = require('tailwindcss/defaultTheme')

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [...],
  theme: {
    extend: {
      transitionProperty: {
        DEFAULT: `${defaultTheme.transitionProperty.DEFAULT}, outline-color`,
        colors: `${defaultTheme.transitionProperty.colors}, outline-color`,
      }
    },
  },
  plugins: [],
}

There is a good chance we add this back for Tailwind CSS v4.0 along with this change to outline-none that only sets the outline-color to transparent when forced-colors is active:

https://play.tailwindcss.com/fFQOGafBjR

.focus\:outline-none:focus {
  outline-style: none;
}

@media screen and (forced-colors: active) {
  .focus\:outline-none:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
  }
}

We've opted not to make this change to outline-none right away so that we have more time to test it, while still correcting this breaking change right away.

@reinink reinink changed the title Remove outline-color from default color properties to transition Revert including outline-color in transition and transition-colors by default Feb 16, 2023
@adamwathan adamwathan merged commit 6e92dfa into master Feb 16, 2023
@adamwathan adamwathan deleted the revert-10385 branch February 16, 2023 18:46
adamwathan pushed a commit that referenced this pull request Feb 16, 2023
…rs` by default (#10604)

* Remove `outline-color` from default color properties to transition (Reverts #10385)

* Update changelog
@kripod
Copy link

kripod commented Feb 19, 2023

Is there a chance a future feature flag could be added for this? Perhaps it may be called transitionOutlineColor.

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.

Input outlines show during transition with Tailwind 3.2.6
3 participants