Skip to content

[context-menu] Menu items do not follow public styling API conventions #795

Closed

Description

@jouni

The following selectors should be considered internal implementation details (e.g. ::slotted(.vaadin-menu-item)), yet they apply styles which belong to a theme:

https://github.com/vaadin/vaadin-context-menu/blob/f0db00898cdaca632127afdf024b88152d60e184/theme/lumo/vaadin-context-menu-styles.html#L39-L81

https://github.com/vaadin/vaadin-context-menu/blob/f0db00898cdaca632127afdf024b88152d60e184/theme/lumo/vaadin-context-menu-styles.html#L89-L104

Any custom theme that wants to for example customize the sub-menu indicator (content: var(--lumo-icons-angle-right);) will need to override an unsupported selector :host(.vaadin-menu-item.vaadin-context-menu-parent-item)::after, which is not guaranteed to be backwards compatible.

Activity

  1. changed the title [-]Menu items do not follow public styling API conventions[/-] [+][context-menu] Menu items do not follow public styling API conventions[/+] on May 28, 2021
  2. rolfsmeds commented on Sep 14, 2022

    @rolfsmeds
    Contributor

    Not sure I ge this – why is the .vaadin-menu-item classname applied and used in those selectors?

  3. jouni commented on Sep 15, 2022

    @jouni
    MemberAuthor

    I assume in order to target any kind of vaadin-*-item, and not need to explicitly list all the different types.

  4. jouni commented on Sep 15, 2022

    @jouni
    MemberAuthor

    (and I should try to remember to not link to source lines in master, because those will inevitably change).
    Edit: updated, linked to the lines at the time of creating this issue.

  5. web-padawan commented on Oct 20, 2022

    @web-padawan
    Member

    These class names were added in vaadin/vaadin-context-menu#200 where vaadin-item element was used. Later on, we changed to use vaadin-context-menu-item in vaadin/vaadin-context-menu#213 but did not remove those class names.

    Let's fix this in V24 by removing usage of .vaadin-menu-item as it's no longer needed.

  6. self-assigned this
    on Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions