nextui-org / nextui

🚀 Beautiful, fast and modern React UI library.
https://nextui.org
MIT License
21.98k stars 1.54k forks source link

[BUG] - Dropdown menu background color #3411

Closed rafpaz closed 4 months ago

rafpaz commented 4 months ago

NextUI Version

@nextui-org/dropdown@2.1.26

Describe the bug

The dropdown menu background color cannot be modified, since the bg-content1 class is set on the content slot, but there is no way to access it or modify it.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Add the dropdown component
  2. Try to change the background color of the menu component that opens on click

Expected behavior

As a user, I expect to be able to change the background color of the dropdown menu, but there is no way to do that

Screenshots or Videos

image

Operating System Version

macOS

Browser

Chrome

linear[bot] commented 4 months ago

ENG-1109 [BUG] - Dropdown menu background color

wingkwong commented 4 months ago

Just checked. You can simply pass the class to Dropdown.

  <Dropdown
    className="bg-red-300" // override bg-content1
  >
    <DropdownTrigger>
      <Button>Trigger</Button>
    </DropdownTrigger>
    <DropdownMenu aria-label="Actions" color={color} variant={variant}>
      <DropdownItem key="new">New file</DropdownItem>
      <DropdownItem key="copy">Copy link</DropdownItem>
      <DropdownItem key="edit">Edit file</DropdownItem>
      <DropdownItem key="delete" className="text-danger" color="danger">
        Delete file
      </DropdownItem>
    </DropdownMenu>
  </Dropdown>