Skip to content

Button component doesn't respect theme colors in dark mode #33338

@ShengDong207

Description

@ShengDong207

Description

The button component doesn't properly respect theme colors when the application is in dark mode. When the dark theme is applied, buttons continue to use the light theme color palette, creating visual inconsistency and accessibility issues.

Steps to Reproduce

  1. Set up a React application with a theme provider that supports both light and dark modes
  2. Create a button component that should inherit colors from the current theme
  3. Switch the application to dark mode
  4. Observe that the button component continues to use light theme colors

Expected Behavior

When the application is in dark mode, the button component should automatically use the dark theme color palette for all its visual elements (background, text, borders, etc.).

Current Behavior

The button component ignores the dark theme settings and continues to display using the light theme color values, creating contrast issues and breaking the visual consistency of the UI.

Possible Solution

Ensure the button component properly subscribes to theme context changes and applies the appropriate color values based on the current theme mode.

Environment

  • React version: 19.1.0
  • Browser: Chrome, Firefox, Safari
  • Operating System: Windows, macOS, Linux

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