Skip to content

Commit 26eb72f

Browse files
fix: add scroller class and fix multi select stories options
1 parent d5271cd commit 26eb72f

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

src/components/select/Select.stories.tsx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,42 @@ const testOptions = [
4141
value: "option-4",
4242
selected: false,
4343
},
44+
{
45+
label: "Option 5",
46+
count: 50,
47+
value: "option-5",
48+
selected: false,
49+
},
50+
{
51+
label: "Option 6",
52+
count: 60,
53+
value: "option-6",
54+
selected: false,
55+
},
56+
{
57+
label: "Option 7",
58+
count: 70,
59+
value: "option-7",
60+
selected: false,
61+
},
62+
{
63+
label: "Option 8",
64+
count: 80,
65+
value: "option-8",
66+
selected: false,
67+
},
68+
{
69+
label: "Option 9",
70+
count: 90,
71+
value: "option-9",
72+
selected: false,
73+
},
74+
{
75+
label: "Option 10",
76+
count: 100,
77+
value: "option-10",
78+
selected: false,
79+
},
4480
];
4581

4682
export const UnModifiedSelect = (args: { colorMode: "light" | "dark" }) => {
@@ -87,6 +123,9 @@ export const UnModifiedSelect = (args: { colorMode: "light" | "dark" }) => {
87123
onOptionSelect={({ action, value, event }) => {
88124
markAsSelected(action, value, event);
89125
}}
126+
styles={{
127+
noResults: "text-red-500",
128+
}}
90129
/>
91130
</MultiSelect>
92131
</div>

src/styles/tailwind.css

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,47 @@ html {
4545
scroll-behavior: smooth !important;
4646
}
4747

48+
/* custom scrollbar */
49+
.scroller {
50+
--scrollbar-color-thumb: #aaa;
51+
--scrollbar-color-track: rgba(60, 60, 60, 0.05);
52+
--scrollbar-width: auto;
53+
--scrollbar-width-legacy: 10px;
54+
}
55+
56+
.dark .scroller {
57+
--scrollbar-color-thumb: #777;
58+
--scrollbar-color-track: rgba(60, 60, 60, 0.1);
59+
}
60+
61+
/* Modern browsers with `scrollbar-*` support */
62+
@supports (scrollbar-width: auto) {
63+
.scroller {
64+
scrollbar-color: var(--scrollbar-color-thumb) var(--scrollbar-color-track);
65+
scrollbar-width: var(--scrollbar-width);
66+
}
67+
}
68+
69+
/* Legacy browsers with `::-webkit-scrollbar-*` support */
70+
@supports selector(::-webkit-scrollbar) {
71+
.scroller::-webkit-scrollbar-thumb {
72+
background: transparent;
73+
}
74+
.scroller::-webkit-scrollbar-track {
75+
background: transparent;
76+
}
77+
.scroller:hover::-webkit-scrollbar-thumb {
78+
background: var(--scrollbar-color-thumb);
79+
}
80+
.scroller:hover::-webkit-scrollbar-track {
81+
background: var(--scrollbar-color-track);
82+
}
83+
.scroller::-webkit-scrollbar {
84+
max-width: var(--scrollbar-width-legacy);
85+
max-height: var(--scrollbar-width-legacy);
86+
}
87+
}
88+
4889
.dark {
4990
--background: #1c1c1e;
5091
--hover-state: #2c2c2e;

0 commit comments

Comments
 (0)