nextui icon indicating copy to clipboard operation
nextui copied to clipboard

[BUG] - Flat variant picks different(wrong?) colors when using custom theme

Open jbree opened this issue 4 months ago • 1 comments

NextUI Version

2.4.8

Describe the bug

When creating a theme with nextui, components with variant="flat" choose different colors for themes with custom names (i.e. not "light" or "dark"). I have observed this specifically with Button and Chip.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

when I create a "dark" theme with the following color config, a button with variant="flat" looks as expected:

dark: {
  colors: {
    "warning": {
      "50": "#4a320b",
      "100": "#744e11",
      "200": "#9f6b17",
      "300": "#ca881e",
      "400": "#f5a524",
      "500": "#f7b54a",
      "600": "#f9c571",
      "700": "#fad497",
      "800": "#fce4bd",
      "900": "#fef4e4",
      "foreground": "#000",
      "DEFAULT": "#f5a524"
    }
  }
},

However, when I create and use a theme with a custom name, but identical color values, the button appears to choose the 800 value for text instead of the DEFAULT color, and a different background color as well.

funk: {
  extend: "dark",
  colors: {
    "warning": {
      "50": "#4a320b",
      "100": "#744e11",
      "200": "#9f6b17",
      "300": "#ca881e",
      "400": "#f5a524",
      "500": "#f7b54a",
      "600": "#f9c571",
      "700": "#fad497",
      "800": "#fce4bd",
      "900": "#fef4e4",
      "foreground": "#000",
      "DEFAULT": "#f5a524"
    }
  }
}

Expected behavior

I expected that this button would look identical in either of these themes. Instead, different colors are used for each theme.

Screenshots or Videos

dark (as expected): image

funk (expected this to look identical to "dark"): image

Operating System Version

macOS

Browser

Chrome

jbree avatar Oct 18 '24 04:10 jbree