Skip to content

bug: .menu-title not working on collapse details/summary menu item #4629

Closed as not planned

Description

@anthony-robin

Reproduction URL (Required)

https://play.tailwindcss.com/spS6hQF6ma
https://play.tailwindcss.com/3QvjI45DRe

What version of daisyUI are you using?

v5.6.18

Which browsers are you seeing the problem on?

Chrome

Describe your issue

Menu with collapse items using details/summary does not render properly the .menu-title item. Arrow is duplicated (native HTML and the Daisy one) and is not aligned.

<ul class="menu bg-base-200 rounded-box w-56">
  <li><a>Item 1</a></li>
  <li>
    <details open>
      <summary class="menu-title">Parent broken style</summary>
      <ul>
        <!-- submenu here -->
      </ul>
    </details>
  <li>
</ul>

I'm expecting to be able to define:

<details open>
  <summary class="menu-title">My title</summary>
  <!-- ... -->
</details>

For now, I have to workaround:

<details open>
  <summary class="font-semibold text-base-content/40">My title</summary>
  <!-- ... -->
</details>

Activity

  1. github-actions commented on Jul 13, 2026

    @github-actions

    Thank you @anthony-robin for reporting issues. It helps daisyUI a lot 💚
    I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
    In the meantime providing more details and reproduction links would be helpful.

  2. pdanpdan commented on Jul 13, 2026

    @pdanpdan
    Contributor

    Hello

    Place the .menu-title inside the summary in this case: https://play.tailwindcss.com/ocXEYRkruU

  3. anthony-robin commented on Jul 13, 2026

    @anthony-robin
    Author

    Thank you !
    Your solution fixes the double arrow issue but there are still padding inconsistency that makes the label to be misaligned and too big in height in comparaison of submenu items and other first level regular items. Arrow does not take the title color either.

    Do you think it should be fixed from Daisy side to work out of the box or should I stay with my workaround by manually specifying the title classes ?

    Note: updated demo with workaround case: https://play.tailwindcss.com/3QvjI45DRe

  4. pdanpdan commented on Jul 13, 2026

    @pdanpdan
    Contributor

    I checked the code and summary.menu-title was excluded on purpose (@saadeghi can you remember a reason for this? It was present from first commit in v5)

    While checking the code I also discovered a problem with how .menu-active was implemented (nesting order preventing it to be an utility) - only in tailwind play

    Design question for the implementation in demo:

    • summary.menu-title text is dimmed when at rest, hovered, and focus-visible
    • summary.menu-title text is bright when at active

    Is it good like this?

    v1: https://play.tailwindcss.com/PGSB43a3VG?file=css

    v2: https://play.tailwindcss.com/3AUwz6tIEq - added an example for .menu-active

  5. anthony-robin commented on Jul 13, 2026

    @anthony-robin
    Author

    Your example with .menu-active looks really great !

  6. pdanpdan commented on Jul 20, 2026

    @pdanpdan
    Contributor

    @anthony-robin
    saadeghi confirmed my concerns about the aspect of the interactive summary when styled as menu-title - the aspect would be of an inactive menu item

    Please style the summary using utility classes.

  7. saadeghi commented on Jul 20, 2026

    @saadeghi
    Owner

    From #4633 (comment)

    Currently there's a visual difference between menu items that are interactive and the ones that are not. Especially the low opacity menu title is supposed to show that it's not clickable. This is important because we don't want confusion from the end user about what is clickable and what is not.

    I think if someone wants this style they can customize it with utility class.

  8. anthony-robin commented on Jul 20, 2026

    @anthony-robin
    Author

    Thank you for clarifying the reason, I will make my own style then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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