|
59 | 59 | minLength = 0,
|
60 | 60 | tTooShort = (n: number) => `Enter ${n} or more characters for suggestions`,
|
61 | 61 |
|
62 |
| - ...attributes |
| 62 | + // Custom styling props |
| 63 | + choicesItemBackgroundColor = "#f3f2f1", |
| 64 | + choicesItemBorderColor = "#b1b4b6", |
| 65 | + choicesItemTextColor = "black", |
| 66 | + ...attributes |
| 67 | +
|
63 | 68 | }: {
|
64 | 69 | id: string;
|
65 | 70 | name: string;
|
|
89 | 94 | sourceSelector?: (query: string, options: any[]) => "api" | "options";
|
90 | 95 | minLength?: number;
|
91 | 96 | tTooShort?: (n: number) => string;
|
| 97 | + choicesItemBackgroundColor?: string; |
| 98 | + choicesItemBorderColor?: string; |
| 99 | + choicesItemTextColor?: string; |
92 | 100 | } & Omit<
|
93 | 101 | import("svelte/elements").HTMLSelectAttributes,
|
94 | 102 | | "id"
|
|
951 | 959 |
|
952 | 960 | <div
|
953 | 961 | class="gem-c-select-with-search"
|
954 |
| - style={`--cross-icon-url: url("${crossIconUrl}")`} |
| 962 | + style={`--cross-icon-url: url("${crossIconUrl}"); --choices-item-bg-color: ${choicesItemBackgroundColor}; --choices-item-border-color: ${choicesItemBorderColor}; --choices-item-text-color: ${choicesItemTextColor};`} |
955 | 963 | >
|
956 | 964 | {#snippet rightIcon()}
|
957 | 965 | <button
|
|
1723 | 1731 | .choices__list[aria-expanded]
|
1724 | 1732 | .choices__item--selectable.is-highlighted
|
1725 | 1733 | ) {
|
1726 |
| - background-color: #1d70b8; |
1727 |
| - border-color: #1d70b8; |
1728 |
| - color: #fff; |
| 1734 | + background-color: var(--choices-item-bg-color, #1d70b8); |
| 1735 | + border-color: var(--choices-item-border-color, #1d70b8); |
| 1736 | + color: var(--choices-item-text-color, #fff); |
1729 | 1737 | outline: none;
|
1730 | 1738 | }
|
1731 | 1739 | :global(.gem-c-select-with-search .choices__heading) {
|
|
0 commit comments