/
spirzen
/
it-knowledge-base
Обзор
Документация
Войти
/
spirzen
/
it-knowledge-base
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
Mobile
src/components/DocSearch/styles.module.css
598 строк
12 KB
Spirzen
Refactor - design, search, styles
01 июн 2026, 16:08
01 июн 2026, 16:08
840a53a
Код
Авторство
О чём код?
/* Токены: ifm + design bridge (--d-*) */ /* ——— Inline-поиск в шапке и на главной ——— */ .bar { position: relative; width: 100%; min-width: 0; } .barHero { width: 100%; } .field { --ds-border: color-mix(in srgb, var(--ifm-color-primary) 22%, var(--ifm-color-emphasis-300)); --ds-bg: color-mix(in srgb, var(--ifm-color-primary) 6%, var(--ifm-background-surface-color)); display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.5rem 0.85rem; border-radius: 10px; border: 1px solid var(--ds-border); background: var(--ds-bg); box-shadow: 0 2px 10px color-mix(in srgb, var(--ifm-color-primary) 10%, transparent); transition: border-color 0.2s ease, box-shadow 0.2s ease; } .field:focus-within { border-color: var(--ifm-color-primary); box-shadow: 0 2px 16px color-mix(in srgb, var(--ifm-color-primary) 22%, transparent); } .barHero .field { padding: 0.75rem 1rem; } .fieldIcon { flex-shrink: 0; color: var(--ifm-color-primary); opacity: 0.9; } .fieldInput { flex: 1; min-width: 0; border: none; background: transparent; font-size: 0.9rem; font-weight: 500; color: var(--ifm-color-content); padding: 0.1rem 0; font-family: inherit; } .barHero .fieldInput { font-size: 1rem; } .fieldInput::placeholder { color: var(--ifm-color-content-secondary); font-weight: 400; opacity: 0.9; } .fieldInput:focus-visible { outline: none; } .fieldKbd { flex-shrink: 0; font-size: 0.68rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 0.12rem 0.35rem; border-radius: 5px; border: 1px solid var(--ifm-color-emphasis-300); background: color-mix(in srgb, var(--ifm-background-color) 70%, transparent); color: var(--ifm-color-content-secondary); line-height: 1.3; } .fieldPlaceholder { font-size: 0.9rem; color: var(--ifm-color-content-secondary); } .dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: calc(var(--ifm-z-index-fixed) + 35); animation: dsFadeIn 0.15s ease-out; } .dropdownPanel { display: flex; flex-direction: column; max-height: min(70vh, 420px); background: var(--ifm-background-color); border: 1px solid color-mix(in srgb, var(--ifm-color-primary) 28%, var(--ifm-color-emphasis-200)); border-radius: calc(var(--ifm-global-radius, 10px) + 2px); box-shadow: var(--ifm-global-shadow-md), 0 16px 40px color-mix(in srgb, var(--ifm-color-primary) 16%, transparent); overflow: hidden; } .dropdownPanel .results { max-height: min(52vh, 360px); } .dropdownPanel .hint, .dropdownPanel .empty, .dropdownPanel .status, .dropdownPanel .error { flex-shrink: 0; } .navbarWrap { display: flex; align-items: center; margin: 0 0.15rem; } .trigger { --ds-border: color-mix(in srgb, var(--ifm-color-primary) 22%, var(--ifm-color-emphasis-300)); --ds-bg: color-mix(in srgb, var(--ifm-color-primary) 6%, var(--ifm-background-surface-color)); --ds-bg-hover: color-mix(in srgb, var(--ifm-color-primary) 12%, var(--ifm-background-surface-color)); display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.32rem 0.55rem 0.32rem 0.5rem; min-width: 10.5rem; max-width: 15rem; border-radius: var(--ifm-global-radius, 8px); border: 1px solid var(--ds-border); background: var(--ds-bg); color: var(--ifm-color-content-secondary); font-size: 0.82rem; line-height: 1.2; cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease; box-shadow: var(--ifm-global-shadow-lw); } .trigger:hover, .trigger:focus-visible { border-color: var(--ifm-color-primary); background: var(--ds-bg-hover); color: var(--ifm-color-primary); box-shadow: 0 2px 10px color-mix(in srgb, var(--ifm-color-primary) 25%, transparent); outline: none; } .triggerIcon { flex-shrink: 0; color: var(--ifm-color-primary); opacity: 0.9; } .triggerLabel { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .triggerKbd { flex-shrink: 0; font-size: 0.68rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 0.12rem 0.35rem; border-radius: 5px; border: 1px solid var(--ifm-color-emphasis-300); background: color-mix(in srgb, var(--ifm-background-color) 70%, transparent); color: var(--ifm-color-content-secondary); line-height: 1.3; } /* Modal */ .backdrop { position: fixed; inset: 0; z-index: calc(var(--ifm-z-index-fixed) + 25); display: flex; align-items: flex-start; justify-content: center; padding: clamp(4rem, 12vh, 7rem) 1rem 1.5rem; background: color-mix(in srgb, var(--ifm-background-color) 15%, rgba(15, 18, 28, 0.55)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: dsFadeIn 0.18s ease-out; } .panel { --ds-panel-border: color-mix(in srgb, var(--ifm-color-primary) 28%, var(--ifm-color-emphasis-200)); width: min(680px, 100%); max-height: min(78vh, 640px); display: flex; flex-direction: column; background: var(--ifm-background-color); border: 1px solid var(--ds-panel-border); border-radius: calc(var(--ifm-global-radius, 12px) + 4px); box-shadow: var(--ifm-global-shadow-md), 0 24px 48px color-mix(in srgb, var(--ifm-color-primary) 18%, transparent); overflow: hidden; animation: dsPanelIn 0.22s cubic-bezier(0.22, 1, 0.36, 1); } .header { display: flex; align-items: center; gap: 0.65rem; padding: 0.85rem 0.85rem 0.85rem 1rem; border-bottom: 1px solid var(--ifm-color-emphasis-200); background: color-mix(in srgb, var(--ifm-color-primary) 5%, var(--ifm-background-color)); } .headerIcon { flex-shrink: 0; color: var(--ifm-color-primary); } .input { flex: 1; min-width: 0; border: none; background: transparent; font-size: 1.05rem; font-weight: 500; color: var(--ifm-color-content); padding: 0.15rem 0; } .input::placeholder { color: var(--ifm-color-content-secondary); font-weight: 400; opacity: 0.85; } .input:focus-visible { outline: none; } .closeBtn { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border: none; border-radius: 8px; background: transparent; color: var(--ifm-color-content-secondary); cursor: pointer; transition: background 0.15s ease, color 0.15s ease; } .closeBtn:hover, .closeBtn:focus-visible { background: color-mix(in srgb, var(--ifm-color-primary) 14%, transparent); color: var(--ifm-color-primary); outline: none; } .body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; } .results { list-style: none; margin: 0; padding: 0.4rem 0.35rem; overflow-y: auto; overscroll-behavior: contain; flex: 1; scroll-padding: 0.5rem 0; } .resultsPending { opacity: 0.72; pointer-events: none; } .result { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 0.1rem 0.5rem; padding: 0.65rem 0.85rem 0.65rem 1rem; margin: 0.12rem 0.35rem; border-radius: calc(var(--ifm-global-radius, 8px) - 2px); text-decoration: none; color: inherit; border: 1px solid transparent; transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; } .result:hover, .resultActive { background: var(--ifm-menu-color-background-active); border-color: color-mix(in srgb, var(--ifm-color-primary) 35%, transparent); box-shadow: inset 3px 0 0 var(--ifm-color-primary); } .resultMain { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.5rem; grid-column: 1; grid-row: 1; min-width: 0; } .resultTitle { font-weight: 600; font-size: 0.94rem; color: var(--ifm-color-content); line-height: 1.35; } .resultSection { flex-shrink: 0; font-size: 0.72rem; font-weight: 500; padding: 0.1rem 0.45rem; border-radius: 999px; background: color-mix(in srgb, var(--ifm-color-primary) 12%, var(--ifm-background-surface-color)); color: var(--ifm-color-primary); border: 1px solid color-mix(in srgb, var(--ifm-color-primary) 25%, transparent); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .resultDesc { grid-column: 1; grid-row: 2; margin: 0; font-size: 0.8rem; line-height: 1.4; color: var(--ifm-color-content-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .resultGo { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 0.85rem; color: var(--ifm-color-content-secondary); opacity: 0; transition: opacity 0.15s ease; } .result:hover .resultGo, .resultActive .resultGo { opacity: 0.65; } .mark { background: color-mix(in srgb, var(--ifm-color-primary) 28%, transparent); color: var(--ifm-color-content); padding: 0 0.1em; border-radius: 3px; font-weight: 600; } .hint { padding: 1.5rem 1.25rem 1.75rem; text-align: center; } .hintLead { margin: 0 0 0.35rem; font-size: 0.95rem; font-weight: 600; color: var(--ifm-color-content); } .hintSub { margin: 0; font-size: 0.82rem; color: var(--ifm-color-content-secondary); } .empty { padding: 2rem 1.25rem; text-align: center; color: var(--ifm-color-content-secondary); font-size: 0.88rem; } .emptyIcon { display: block; font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.35; } .empty p { margin: 0; } .status { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.55rem; } .skeleton, .skeletonShort { height: 0.85rem; border-radius: 6px; background: linear-gradient( 90deg, var(--ifm-color-emphasis-100) 0%, color-mix(in srgb, var(--ifm-color-primary) 8%, var(--ifm-color-emphasis-200)) 50%, var(--ifm-color-emphasis-100) 100% ); background-size: 200% 100%; animation: dsShimmer 1.2s ease-in-out infinite; } .skeleton { width: 88%; } .skeletonShort { width: 55%; } .error { padding: 1.25rem; font-size: 0.85rem; color: var(--ifm-color-danger, #d32f2f); line-height: 1.45; } .error code { font-size: 0.8em; } .footer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.85rem; padding: 0.55rem 1rem; border-top: 1px solid var(--ifm-color-emphasis-200); background: color-mix(in srgb, var(--ifm-color-primary) 4%, var(--ifm-background-surface-color)); font-size: 0.72rem; color: var(--ifm-color-content-secondary); } .footerItem { display: inline-flex; align-items: center; gap: 0.25rem; } .footerCount { margin-left: auto; font-weight: 600; color: var(--ifm-color-primary); } .kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 1.35rem; padding: 0.1rem 0.3rem; border-radius: 4px; border: 1px solid var(--ifm-color-emphasis-300); background: var(--ifm-background-color); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.68rem; line-height: 1.25; color: var(--ifm-color-content); } @keyframes dsFadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes dsPanelIn { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } } @keyframes dsShimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } } @media (max-width: 996px) { .trigger { min-width: 2.35rem; max-width: 2.35rem; padding: 0.38rem; justify-content: center; } .triggerLabel, .triggerKbd { display: none; } .fieldKbd { display: none; } .navbar-sidebar .bar { width: 100%; margin: 0.5rem 0 0.75rem; } .navbar-sidebar .dropdown { position: static; margin-top: 0.35rem; } .backdrop { padding-top: 5rem; align-items: flex-start; } .panel { max-height: 85vh; } .footer { gap: 0.4rem 0.55rem; } .footerCount { width: 100%; margin-left: 0; text-align: right; } } @media (prefers-reduced-motion: reduce) { .backdrop, .panel, .skeleton, .skeletonShort { animation: none; } .resultsPending { opacity: 0.85; } }