| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- .toc {
- border-radius: 12px;
- border: 1px solid var(--content-border-color);
- background: var(--content-bg-color);
- overflow: hidden;
- &__header {
- padding: 20px 56px 20px 24px;
- cursor: pointer;
- position: relative;
- user-select: none;
- transition: background-color 0.2s ease;
- &:hover {
- background-color: rgba(0, 0, 0, 0.02);
- }
- // Крестик с псевдоэлементами
- &::before,
- &::after {
- content: '';
- position: absolute;
- right: 24px;
- top: 50%;
- width: 16px;
- height: 2px;
- background-color: var(--text-color);
- transition: transform 0.3s ease;
- }
- &::before {
- transform: translateY(-50%) rotate(90deg);
- }
- &::after {
- transform: translateY(-50%);
- }
- }
- &__title {
- margin: 0;
- color: var(--Main-Back, #000);
- font-size: 18px;
- font-style: normal;
- font-weight: 700;
- line-height: normal;
- text-transform: uppercase;
- color: var(--text-color);
- @include mobile{
- font-size:16px;
- }
- }
- &__content {
- max-height: 0;
- overflow: hidden;
- transition: max-height 0.3s ease;
- }
- &__list {
- list-style: none;
- margin: 0;
- padding: 0 24px 24px 24px;
- counter-reset: toc-counter;
- // Вложенный список (второй уровень) - с маркерами
- &--nested {
- padding: 8px 0 0 28px;
- list-style: disc;
- padding-left: 40px;
- }
- }
- &__item {
- margin-bottom: 8px;
- position: relative;
- &:last-child {
- margin-bottom: 0;
- }
- // Нумерация только для первого уровня
- > .toc__link::before {
- counter-increment: toc-counter;
- content: counter(toc-counter) ". ";
- font-weight: 600;
- margin-right: 4px;
- }
- // Убираем нумерацию для вложенного уровня
- .toc__list--nested > & > .toc__link::before {
- content: none;
- }
- }
- &__link {
- display: block;
- color: var(--text-color);
- text-decoration: none;
- font-size: 14px;
- line-height: 20px;
- padding: 6px 12px;
- border-radius: 6px;
- transition: all 0.2s ease;
- &:hover {
- background-color: rgba(0, 0, 0, 0.03);
- color: var(--link-color);
- }
- // Стили для вложенного уровня
- .toc__list--nested > .toc__item > & {
- font-size: 13px;
- padding-left: 8px;
- }
- }
- // Active state (открыто)
- &.active {
- .toc__header::before {
- transform: translateY(-50%) rotate(45deg);
- }
- .toc__header::after {
- transform: translateY(-50%) rotate(-45deg);
- }
- .toc__content {
- max-height: 1000px;
- }
- }
- }
|