Skip to content

Why is the default outline not removed? #2949

Discussion options

You must be logged in to vote

Hi @jeroenvanrensen 👋

It's not the default because that outline is very important for accessibility reasons.

If you're going to remove it, it's recommended that you always implement a visual replacement for that outline. The ring utilities are great for this!

Here's a quick video that explains them in details: https://www.youtube.com/watch?v=ZbefZhgq9iQ

Now, you could do what @chr-ge suggests above, but I would add the base focus:ring class as a substitute as well:

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

@layer base {
  button {
    @apply focus:outline-none focus:ring;
  }
}

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by simonswiss
Comment options

You must be logged in to vote
1 reply
@simonswiss
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants