Skip to content

Commit 2c82396

Browse files
authored
Merge pull request #288 from GBSL-Informatik:polish-sidebar-progress
polish sidebar progress icon
2 parents b625c33 + ea0ee1c commit 2c82396

2 files changed

Lines changed: 33 additions & 4 deletions

File tree

packages/tdev/page-index/components/TaskableState/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ const TaskableState = observer((props: Props) => {
3535
title={`Progress: ${page.progress} / ${page.totalSteps}`}
3636
onClick={(e) => {
3737
const thisElement = e.currentTarget;
38-
thisElement.parentElement?.querySelector('a')?.click();
38+
const categoryButton = thisElement.parentElement?.querySelector<HTMLButtonElement>(
39+
'&>li.theme-doc-sidebar-item-category>div.menu__list-item-collapsible>button'
40+
);
41+
if (categoryButton) {
42+
categoryButton.click();
43+
} else {
44+
thisElement.parentElement?.querySelector('a')?.click();
45+
}
3946
}}
4047
>
4148
<Icon

src/theme/DocSidebarItem/styles.module.scss

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
right: 0.5em;
66
top: 0;
77
z-index: 0;
8-
&.category {
9-
right: 3em;
10-
}
118
}
129
&:has(> .icon:hover) {
1310
> li:has(+ .icon:hover) {
@@ -17,4 +14,29 @@
1714
}
1815
}
1916
}
17+
&:has(> .icon) {
18+
> li:global(.theme-doc-sidebar-item-category) {
19+
&::after {
20+
content: '';
21+
position: absolute;
22+
right: 0.5em;
23+
top: 0;
24+
height: 2em;
25+
width: 2em;
26+
background: var(--ifm-color-gray-600);
27+
clip-path: polygon(83% 12%, 90% 21%, 90% 42%, 100% 50%, 90% 58%, 90% 79%, 83% 88%);
28+
transform: rotate(90deg);
29+
transition: transform 0.3s ease;
30+
transition-delay: 0.2s;
31+
}
32+
&:global(.menu__list-item--collapsed) {
33+
&::after {
34+
transform: rotate(0deg);
35+
}
36+
}
37+
button:global(.clean-btn.menu__caret) {
38+
opacity: 0;
39+
}
40+
}
41+
}
2042
}

0 commit comments

Comments
 (0)