web-components
web-components copied to clipboard
[list-box] Refactor API for configuring item checkmark
- in
vaadin-itemwe have this code:
:host([tabindex])::before {
display: var(--_lumo-item-selected-icon-display, none);
content: var(--lumo-icons-checkmark);
}
- In
vaadin-list-boxwe use it like this
:host {
--_lumo-item-selected-icon-display: var(--_lumo-list-box-item-selected-icon-display, block);
}
- In
vaadin-context-menu, we override it like this:
:host {
--_lumo-list-box-item-selected-icon-display: none;
}
- However, in context-menu with nested menus, we reset it like this:
:host(.vaadin-menu-list-box) {
--_lumo-list-box-item-selected-icon-display: block;
}
In future major releases, we need to come up with a better API.