/
spirzen
/
it-knowledge-base
Обзор
Документация
Войти
/
spirzen
/
it-knowledge-base
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/theme/DocItem/Layout/styles.module.css
281 строка
6 KB
Spirzen
Big design rework
03 июн 2026, 00:53
03 июн 2026, 00:53
47730ce
Код
Авторство
О чём код?
/** * Базовые стили DocItem Layout (на основе стандартной темы Docusaurus) */ .docItemRow { width: 100%; min-width: 0; } .docItemContainer header + *, .docItemContainer article > *:first-child { margin-top: 0; } .docItemCol { min-width: 0; } @media (min-width: 997px) { .docItemRow { display: flex; flex-wrap: nowrap; /* stretch: колонка TOC должна быть высотой с статью, иначе sticky «уезжает» вверх */ align-items: stretch; gap: var(--it-doc-article-gap, 1rem); margin-left: 0; margin-right: 0; } .docItemRow > :global(.col) { padding-left: 0; padding-right: 0; } .docItemCol { flex: 1 1 0; width: 0; max-width: none !important; min-width: 0; } .docSidebarCol { flex: 0 0 var(--it-doc-toc-width); width: var(--it-doc-toc-width); max-width: var(--it-doc-toc-width); } } /* Правая колонка с прогресс-баром и оглавлением */ .docSidebarCol { display: flex; flex-direction: column; flex-shrink: 0; align-self: stretch; position: relative; z-index: 2; min-width: 0; } .docSidebarColCollapsed { flex: 0 0 auto !important; width: auto !important; max-width: none !important; } .docSidebarInner { position: sticky; top: var(--ifm-navbar-height); display: flex; flex-direction: column; gap: 1rem; max-height: calc(100vh - var(--ifm-navbar-height)); overflow: hidden; } .docTocScroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; } /* Прогресс-бар главы */ .chapterProgress { flex-shrink: 0; padding: 0.75rem 1rem; border-radius: 8px; background: var(--ifm-card-background-color); box-shadow: var(--ifm-global-shadow-lw); border: 1px solid var(--ifm-color-emphasis-300); } .chapterProgressHeader { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; } .chapterProgressLabel { font-size: 0.85rem; font-weight: 600; color: var(--ifm-color-content); } .chapterProgressPercent { font-size: 0.85rem; font-weight: 600; color: var(--ifm-color-primary); } .chapterProgressBar { position: relative; height: 6px; border-radius: 999px; background: var(--ifm-color-emphasis-200); overflow: hidden; } .chapterProgressBarInner { position: absolute; top: 0; left: 0; bottom: 0; border-radius: inherit; background: linear-gradient( 90deg, var(--ifm-color-primary), var(--ifm-color-primary-dark) ); transition: width 0.15s ease-out; } /* Кликабельные теги в статьях */ .clickableTag { cursor: pointer; text-decoration: none; transition: transform 0.1s ease-out, box-shadow 0.15s ease-out, background-color 0.15s ease-out; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); } .clickableTag:hover, .clickableTag:focus-visible { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16); outline: none; } .clickableTag:focus-visible { box-shadow: 0 0 0 2px var(--ifm-color-primary); } /* --- Панель «Содержание» (сворачивание) --- */ .tocControlIcon { display: block; width: 0.9rem; height: 0.9rem; flex-shrink: 0; } .tocPanelHeader { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-shrink: 0; padding: 0.55rem 0.65rem 0.45rem; border-bottom: 1px solid var(--ifm-color-emphasis-200); } .tocPanelTitle { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ifm-color-content-secondary); } .tocCollapseBtn { display: inline-flex; align-items: center; justify-content: center; width: 1.625rem; height: 1.625rem; padding: 0; border: none; border-radius: 999px; background: transparent; color: var(--ifm-color-content-secondary); cursor: pointer; opacity: 0.72; transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.15s ease; } .tocCollapseBtn:hover, .tocCollapseBtn:focus-visible { opacity: 1; color: var(--ifm-color-primary); background: color-mix(in srgb, var(--ifm-color-primary) 12%, transparent); transform: translateX(1px); outline: none; } .tocExpandTab { position: sticky; z-index: 4; top: calc(var(--ifm-navbar-height) + 1rem); align-self: flex-end; margin-top: 1rem; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; width: 2rem; padding: 0.7rem 0; border: 1px solid var(--ifm-color-emphasis-200); border-right: none; border-radius: 10px 0 0 10px; background: var(--ifm-card-background-color); box-shadow: -3px 2px 14px color-mix(in srgb, var(--ifm-color-emphasis-900) 8%, transparent), inset 3px 0 0 color-mix(in srgb, var(--ifm-color-primary) 55%, transparent); color: var(--ifm-color-content-secondary); cursor: pointer; transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease; } .tocExpandTab:hover, .tocExpandTab:focus-visible { color: var(--ifm-color-primary); border-color: color-mix(in srgb, var(--ifm-color-primary) 35%, var(--ifm-color-emphasis-200)); box-shadow: -5px 3px 18px color-mix(in srgb, var(--ifm-color-primary) 16%, transparent), inset 3px 0 0 var(--ifm-color-primary); transform: translateX(-2px); outline: none; } .tocExpandTab .tocControlIcon:last-child { width: 0.75rem; height: 0.75rem; opacity: 0.75; } .tocExpandTab:hover .tocControlIcon:last-child, .tocExpandTab:focus-visible .tocControlIcon:last-child { opacity: 1; } @media (prefers-reduced-motion: reduce) { .tocCollapseBtn, .tocExpandTab { transition: none; } .tocCollapseBtn:hover, .tocCollapseBtn:focus-visible, .tocExpandTab:hover, .tocExpandTab:focus-visible { transform: none; } } @media (max-width: 996px) { .tocExpandTab { display: none; } }