Skip to content

Commit 0122397

Browse files
feat(SidebarItem): hover effect (#7934)
* fix: add hover effect to sidebar links (#7893) * fix(sidebar): update hover to neutral grey for consistency with nav links * chore: remove unrelated style changes, keep necessary margin and rounded corners * fix: include right-arrow icon in hover background; remove margin, rounded corners, and clean unrelated styles as per review * fix(sidebar): move flex styles to CSS file & adding margin , rounded on item * fix(ui): update sidebar hover effect as per review suggestion for consistency
1 parent 9c6c05d commit 0122397

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

packages/ui-components/src/Containers/Sidebar/SidebarItem/index.module.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,42 @@
44
@apply font-regular
55
relative
66
z-20
7+
mb-px
78
flex
89
w-full
910
items-center
1011
overflow-hidden
12+
rounded-md
1113
text-sm
1214
text-neutral-800
1315
dark:text-neutral-200;
1416

17+
&:hover {
18+
&:not(.progression) .label {
19+
@apply rounded-sm
20+
bg-neutral-100
21+
text-neutral-900
22+
dark:bg-neutral-800
23+
dark:text-neutral-100;
24+
}
25+
26+
.icon {
27+
@apply scale-110
28+
text-green-600
29+
dark:text-green-400;
30+
}
31+
32+
.progressionIcon {
33+
@apply fill-green-200
34+
dark:fill-green-300;
35+
}
36+
}
37+
1538
.label {
1639
@apply font-regular
40+
flex
41+
items-center
42+
gap-1.5
1743
p-2
1844
text-sm;
1945
}
@@ -37,6 +63,12 @@
3763
.label {
3864
@apply p-1;
3965
}
66+
67+
&:not(.active):hover .label {
68+
@apply rounded-sm
69+
bg-neutral-100
70+
dark:bg-neutral-900;
71+
}
4072
}
4173

4274
&.active {

packages/ui-components/src/Containers/Sidebar/SidebarItem/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ const SidebarItem: FC<SidebarItemProps> = ({
3434
{showProgressionIcons && (
3535
<ProgressionIcon className={styles.progressionIcon} />
3636
)}
37-
<span className={styles.label}>{label}</span>
3837

39-
{/^https?:/.test(link) && <ArrowUpRightIcon className={styles.icon} />}
38+
<div className={styles.label}>
39+
<span>{label}</span>
40+
41+
{/^https?:/.test(link) && <ArrowUpRightIcon className={styles.icon} />}
42+
</div>
4043
</BaseActiveLink>
4144
);
4245

0 commit comments

Comments
 (0)