Skip to content

Commit 473923a

Browse files
committed
add to styles - not inline
1 parent ef3f1e1 commit 473923a

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

src/components/sidebarTableOfContents/index.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,7 @@ function recursiveRender(items: TocItem[]) {
3333
} as React.CSSProperties
3434
}
3535
>
36-
<a
37-
href={`${i.url}`}
38-
style={{
39-
textOverflow: 'ellipsis',
40-
overflow: 'hidden',
41-
whiteSpace: 'nowrap',
42-
display: 'block',
43-
}}
44-
title={i.title}
45-
>
46-
{i.title}
47-
</a>
36+
<a href={`${i.url}`}>{i.title}</a>
4837
{i.children && <ul>{recursiveRender(i.children)}</ul>}
4938
</li>
5039
);

src/components/sidebarTableOfContents/style.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
position: relative;
1919
line-height: 1.5;
2020
display: block;
21+
text-overflow: ellipsis;
22+
overflow: hidden;
23+
white-space: nowrap;
24+
2125
color: var(--link-color);
2226
padding: 0.25em 0;
2327
opacity: 0.8;

0 commit comments

Comments
 (0)