|
| 1 | +/** |
| 2 | + * @license |
| 3 | + * Copyright (c) 2017 - 2025 Vaadin Ltd. |
| 4 | + * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ |
| 5 | + */ |
| 6 | +:host { |
| 7 | + display: flex; |
| 8 | + align-items: center; |
| 9 | + box-sizing: border-box; |
| 10 | + font-family: var(--lumo-font-family); |
| 11 | + font-size: var(--lumo-font-size-m); |
| 12 | + line-height: var(--lumo-line-height-xs); |
| 13 | + padding: 0.5em calc(var(--lumo-space-l) + var(--lumo-border-radius-m) / 4) 0.5em |
| 14 | + var(--_lumo-list-box-item-padding-left, calc(var(--lumo-border-radius-m) / 4)); |
| 15 | + min-height: var(--lumo-size-m); |
| 16 | + outline: none; |
| 17 | + border-radius: var(--lumo-border-radius-m); |
| 18 | + cursor: var(--lumo-clickable-cursor); |
| 19 | + -webkit-font-smoothing: antialiased; |
| 20 | + -moz-osx-font-smoothing: grayscale; |
| 21 | + -webkit-tap-highlight-color: var(--lumo-primary-color-10pct); |
| 22 | + --_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct)); |
| 23 | + --_focus-ring-width: var(--vaadin-focus-ring-width, 2px); |
| 24 | + --_selection-color-text: var(--vaadin-selection-color-text, var(--lumo-primary-text-color)); |
| 25 | +} |
| 26 | + |
| 27 | +:host([hidden]) { |
| 28 | + display: none !important; |
| 29 | +} |
| 30 | + |
| 31 | +/* Checkmark */ |
| 32 | +[part='checkmark']::before { |
| 33 | + display: var(--_lumo-item-selected-icon-display, none); |
| 34 | + content: var(--lumo-icons-checkmark); |
| 35 | + font-family: lumo-icons; |
| 36 | + font-size: var(--lumo-icon-size-m); |
| 37 | + line-height: 1; |
| 38 | + font-weight: normal; |
| 39 | + width: 1em; |
| 40 | + height: 1em; |
| 41 | + margin: calc((1 - var(--lumo-line-height-xs)) * var(--lumo-font-size-m) / 2) 0; |
| 42 | + color: var(--_selection-color-text); |
| 43 | + flex: none; |
| 44 | + opacity: 0; |
| 45 | + transition: |
| 46 | + transform 0.2s cubic-bezier(0.12, 0.32, 0.54, 2), |
| 47 | + opacity 0.1s; |
| 48 | +} |
| 49 | + |
| 50 | +:host([selected]) [part='checkmark']::before { |
| 51 | + opacity: 1; |
| 52 | +} |
| 53 | + |
| 54 | +:host([active]:not([selected])) [part='checkmark']::before { |
| 55 | + transform: scale(0.8); |
| 56 | + opacity: 0; |
| 57 | + transition-duration: 0s; |
| 58 | +} |
| 59 | + |
| 60 | +[part='content'] { |
| 61 | + flex: auto; |
| 62 | +} |
| 63 | + |
| 64 | +/* Disabled */ |
| 65 | +:host([disabled]) { |
| 66 | + color: var(--lumo-disabled-text-color); |
| 67 | + cursor: default; |
| 68 | + pointer-events: none; |
| 69 | +} |
| 70 | + |
| 71 | +/* TODO a workaround until we have "focus-follows-mouse". After that, use the hover style for focus-ring as well */ |
| 72 | +@media (any-hover: hover) { |
| 73 | + :host(:hover:not([disabled])) { |
| 74 | + background-color: var(--lumo-primary-color-10pct); |
| 75 | + } |
| 76 | +} |
| 77 | + |
| 78 | +:host([focus-ring]:not([disabled])) { |
| 79 | + box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color); |
| 80 | +} |
| 81 | + |
| 82 | +/* RTL specific styles */ |
| 83 | +:host([dir='rtl']) { |
| 84 | + padding-left: calc(var(--lumo-space-l) + var(--lumo-border-radius-m) / 4); |
| 85 | + padding-right: var(--_lumo-list-box-item-padding-left, calc(var(--lumo-border-radius-m) / 4)); |
| 86 | +} |
| 87 | + |
| 88 | +/* Slotted icons */ |
| 89 | +:host ::slotted(vaadin-icon) { |
| 90 | + width: var(--lumo-icon-size-m); |
| 91 | + height: var(--lumo-icon-size-m); |
| 92 | +} |
0 commit comments