Skip to content

Commit 301f656

Browse files
committed
Match listbox items to menu styling
1 parent 598c745 commit 301f656

1 file changed

Lines changed: 22 additions & 17 deletions

File tree

src/v2/components/forms/shared/listboxStyles.ts

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ import { css } from 'lit'
33
export const listboxStyles = css`
44
:host { /* default theme */
55
--input-background: var(--color-background, #F8F9FB);
6-
--item-text: var(--color-text, #1A1A1A);
6+
--item-text: var(--color-text-heading, #000000);
77
--item-selected-text: var(--color-primary, #7c4dff);
8-
--item-hover-background: var(--lavender-300, #e6dcff);
9-
--item-selected-background: var(--lavender-400, #cbb9ff);
8+
--item-hover-background: var(--color-header-menu-item-hover, #e6dcff);
9+
--item-selected-background: var(--color-header-menu-item-selected, #cbb9ff);
1010
--listbox-z-index: 1;
1111
}
1212
1313
:host([theme='dark']) {
1414
--input-background: var(--color-background, #1A1A1A);
15-
--item-text: var(--color-text, #F8F9FB);
15+
--item-text: var(--color-text-heading, #F8F9FB);
1616
--item-selected-text: var(--color-primary, #7c4dff);
17-
--item-hover-background: var(--lavender-300, #e6dcff);
18-
--item-selected-background: var(--lavender-400, #cbb9ff);
17+
--item-hover-background: var(--color-header-menu-item-hover, #e6dcff);
18+
--item-selected-background: var(--color-header-menu-item-selected, #cbb9ff);
1919
--listbox-z-index: 1;
2020
}
2121
@@ -24,6 +24,9 @@ export const listboxStyles = css`
2424
top: 0;
2525
left: 0;
2626
right: 0;
27+
display: flex;
28+
flex-direction: column;
29+
gap: 0.0625rem;
2730
margin: 0;
2831
padding: 0;
2932
list-style: none;
@@ -33,32 +36,38 @@ export const listboxStyles = css`
3336
background-color: var(--input-background);
3437
opacity: 1;
3538
overflow: hidden;
39+
padding: 0.25rem;
3640
z-index: var(--listbox-z-index);
3741
box-shadow: 0 4px 12px rgba(124, 77, 255, 0.12);
3842
}
3943
4044
.listbox-item {
4145
display: flex;
4246
align-items: center;
47+
gap: var(--spacing-2xs, 0.625rem);
4348
width: 100%;
44-
min-height: var(--select-trigger-height, var(--min-touch-target, 44px));
45-
padding: var(--spacing-xxs, 0.3125rem) var(--spacing-xs, 0.75rem);
49+
min-height: calc(var(--font-size-sm, 0.875rem) + 1rem);
50+
padding: 0.5rem var(--spacing-xs, 0.75rem);
4651
border: none;
47-
border-bottom: 1px solid var(--color-border, #E5E7EB);
48-
background: var(--input-background);
52+
border-radius: var(--border-radius-sm, 0.2rem);
53+
background: transparent;
4954
color: var(--item-text);
5055
cursor: pointer;
5156
font: inherit;
57+
font-size: var(--font-size-sm, 0.875rem);
58+
font-weight: var(--font-weight-normal, 400);
5259
line-height: normal;
5360
text-align: left;
61+
text-decoration: none;
5462
box-sizing: border-box;
5563
}
5664
57-
.listbox-item:last-child {
58-
border-bottom: none;
65+
.listbox-item:hover {
66+
background: var(--item-hover-background);
67+
border-radius: var(--border-radius-sm, 0.2rem);
5968
}
6069
61-
.listbox-item:hover {
70+
.listbox-item:focus {
6271
background: var(--item-hover-background);
6372
border-radius: var(--border-radius-sm, 0.2rem);
6473
}
@@ -70,10 +79,6 @@ export const listboxStyles = css`
7079
outline: none;
7180
}
7281
73-
.listbox-item-selected {
74-
font-weight: var(--font-weight-bold, 600);
75-
}
76-
7782
.listbox-item-disabled {
7883
opacity: 0.55;
7984
cursor: not-allowed;

0 commit comments

Comments
 (0)