Skip to content

Commit

Permalink
feat! (Toc): Split Toc on components and make it more stateful
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3k0 authored and 3y3 committed Jan 27, 2023
1 parent 60bd6db commit dab3dc1
Show file tree
Hide file tree
Showing 5 changed files with 338 additions and 250 deletions.
41 changes: 4 additions & 37 deletions src/components/Toc/Toc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,47 +97,14 @@ $leftOffset: 57px;
cursor: pointer;
user-select: none;

&-link {
display: block;
text-decoration: none;
}

&-text {
position: relative;
padding: 7px 12px 7px 20px;
word-break: break-word;

color: var(--yc-color-text-primary);

&::before {
content: '';
position: absolute;
top: 0;
right: 0;
// hack: to be shure that it will always start from the left of the TOC
left: -100vw;
height: 100%;
}

&:hover {
border-radius: 3px;
background: var(--yc-color-base-simple-hover);
}
}

&-icon {
position: absolute;
left: 0;
}

&_main > *:first-child {
color: var(--yc-color-text-primary);
}

&_active {
border-radius: 3px;
background: var(--yc-color-base-selection);
}
//&_active {
// border-radius: 3px;
// background: var(--yc-color-base-selection);
//}

&:not(&_opened) > #{$class}__list {
display: none;
Expand Down
Loading

0 comments on commit dab3dc1

Please sign in to comment.