Skip to content

Improve default reset of button styles for high contrast mode #11088

Closed
@jiri-thiemel-te

Description

@jiri-thiemel-te

What version of Tailwind CSS are you using?

For example: v3.3.1

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

For example: Next.js 13.3.1

What version of Node.js are you using?

For example: v17.9.1

What browser are you using?

Chrome, Firefox, Edge

What operating system are you using?

Windows

Reproduction URL

https://play.tailwindcss.com/4DgqvH5JDl

Describe your issue

Buttons that don't have a border defined won't be recognizable as a button in high contrast mode. Each button should have a border, even though it would be a transparent one. In high contrast mode background colours are overridden and buttons without border are very hard to identify in many scenarios as they look just like a regular text. Any border is also overridden with a custom contrast colour even the transparent one, which solves the issue. The problem is that many developers know about this issue and won't set a transparent border or custom appearance for high contrast scheme. And even those that do about this issue don't want to do this every time. There definitely should be reasonable defaults.

Solution

Change the default button reset to include a transparent border.

If you consider this change problematic because of backwards compatibility, let's discuss alternative approach.

Related issues

#2460

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions