/
spirzen
/
it-knowledge-base
Обзор
Документация
Войти
/
spirzen
/
it-knowledge-base
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/css/it-demo-shell.css
631 строка
14 KB
Spirzen
Big design rework
03 июн 2026, 00:53
03 июн 2026, 00:53
47730ce
Код
Авторство
О чём код?
/* ============================================================================ Интерактивные демо-виджеты (React-компоненты в статьях) Используют переменные из custom.css — светлая и тёмная тема ============================================================================ */ .it-demo { --demo-gap: clamp(0.75rem, 2vw, 1.25rem); --demo-pad: clamp(0.75rem, 2.5vw, 1.25rem); --demo-radius: var(--ifm-card-border-radius, 12px); --demo-border: var(--ifm-color-emphasis-300, #e0e0e0); --demo-surface: var(--ifm-card-background-color); --demo-muted: var(--ifm-color-content-secondary); --demo-code-bg: var(--ifm-code-background); --demo-code-fg: var(--ifm-pre-color); --demo-syntax-kw: color-mix(in srgb, var(--ifm-color-primary) 55%, var(--demo-code-fg)); --demo-syntax-type: color-mix(in srgb, #2e7d32 70%, var(--demo-code-fg)); --demo-syntax-fn: color-mix(in srgb, var(--ifm-color-primary-dark, var(--ifm-color-primary)) 45%, var(--demo-code-fg)); --demo-syntax-str: color-mix(in srgb, #c45c26 65%, var(--demo-code-fg)); --demo-syntax-access: color-mix(in srgb, #1565c0 55%, var(--demo-code-fg)); --demo-syntax-var: color-mix(in srgb, var(--ifm-color-primary) 35%, var(--demo-code-fg)); --demo-syntax-comment: var(--demo-muted); --demo-syntax-plain: var(--demo-code-fg); --demo-highlight: rgba(123, 104, 238, 0.2); --demo-success: #2e7d32; --demo-warning: #ed6c02; --demo-error: #c62828; --demo-info: var(--ifm-color-primary); font-family: var(--ifm-font-family-base); color: var(--ifm-color-content); margin: var(--it-doc-demo-gap, 1.5rem) 0; max-width: 100%; box-sizing: border-box; } [data-theme='dark'] .it-demo { --demo-highlight: rgba(147, 112, 219, 0.28); --demo-syntax-kw: #c586c0; --demo-syntax-type: #4ec9b0; --demo-syntax-fn: #dcdcaa; --demo-syntax-str: #ce9178; --demo-syntax-access: #569cd6; --demo-syntax-var: #9cdcfe; --demo-syntax-comment: #8ea17d; --demo-syntax-plain: #d4d4d4; } html[data-design]:not([data-design='design-universe-original']) .it-demo { --demo-syntax-kw: var(--d-code-syntax-keyword); --demo-syntax-type: var(--d-code-syntax-builtin); --demo-syntax-fn: var(--d-code-syntax-function); --demo-syntax-str: var(--d-code-syntax-string); --demo-syntax-access: var(--d-code-syntax-keyword); --demo-syntax-var: var(--d-code-syntax-function); --demo-syntax-comment: var(--d-code-syntax-comment); --demo-syntax-plain: var(--d-code-fg); } .it-demo *, .it-demo *::before, .it-demo *::after { box-sizing: border-box; } .it-demo--loading { padding: var(--demo-pad); color: var(--demo-muted); font-size: 0.9rem; text-align: center; border: 1px dashed var(--demo-border); border-radius: var(--demo-radius); background: var(--ifm-background-surface-color); } /* Карточка / контейнер */ .it-demo__card { background: var(--demo-surface); border: 1px solid var(--demo-border); border-radius: var(--demo-radius); box-shadow: var(--ifm-global-shadow-lw); overflow: hidden; } .it-demo__body { padding: var(--demo-pad); } .it-demo__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding: var(--demo-pad); border-bottom: 1px solid var(--demo-border); background: var(--ifm-background-surface-color); } .it-demo__header-text { flex: 1; min-width: 0; } .it-demo__fullscreen-btn { flex-shrink: 0; padding: 0.35rem 0.65rem; font-size: 0.78rem; font-weight: 600; line-height: 1.2; border-radius: 6px; border: 1px solid var(--demo-border); background: var(--ifm-background-color); color: var(--ifm-color-content); cursor: pointer; font-family: inherit; } .it-demo__fullscreen-btn:hover { border-color: var(--ifm-color-primary); color: var(--ifm-color-primary); } .it-demo__fullscreen-btn--shell { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 3; } .it-demo--fullscreen { position: fixed; inset: 0.5rem; z-index: 200; margin: 0 !important; max-width: none !important; width: auto; display: flex; flex-direction: column; background: var(--ifm-background-color); border-radius: var(--demo-radius); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28); overflow: hidden; } .it-demo--fullscreen.it-demo__card, .it-demo--fullscreen .it-demo__card { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: inherit; } .it-demo--fullscreen .it-demo__body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; } .it-demo:has(> .it-demo__fullscreen-btn--shell) { position: relative; } .it-demo--fullscreen:has(> .it-demo__fullscreen-btn--shell) { position: fixed; } .it-demo__title { margin: 0; font-size: clamp(1rem, 2.5vw, 1.15rem); font-weight: 600; color: var(--ifm-color-content); line-height: 1.35; } .it-demo__subtitle { margin: 0.35rem 0 0; font-size: 0.875rem; color: var(--demo-muted); line-height: 1.5; } .it-demo__online-link { margin: 0.75rem 0 0; padding-top: 0.65rem; border-top: 1px dashed var(--demo-border); font-size: 0.8rem; line-height: 1.5; color: var(--demo-muted); } .it-demo__online-link a { font-weight: 600; } /* Сетки */ .it-demo__grid { display: grid; gap: var(--demo-gap); } .it-demo__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .it-demo__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } @media (max-width: 996px) { .it-demo__grid--2, .it-demo__grid--3 { grid-template-columns: 1fr; } } .it-demo__row { display: flex; flex-wrap: wrap; gap: var(--demo-gap); align-items: center; } /* Кнопки */ .it-demo__btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 600; font-family: inherit; line-height: 1.25; border-radius: 8px; border: 1px solid transparent; cursor: pointer; transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease; white-space: nowrap; } .it-demo__btn:disabled { opacity: 0.55; cursor: not-allowed; } .it-demo__btn--primary { background: var(--ifm-button-background-color); color: var(--ifm-button-color); border-color: var(--ifm-button-background-color); } .it-demo__btn--primary:hover:not(:disabled) { background: var(--ifm-color-primary-dark); border-color: var(--ifm-color-primary-dark); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(123, 104, 238, 0.25); } .it-demo__btn--secondary { background: var(--ifm-background-surface-color); color: var(--ifm-color-content); border-color: var(--demo-border); } .it-demo__btn--secondary:hover:not(:disabled) { border-color: var(--ifm-color-primary); color: var(--ifm-color-primary); } .it-demo__btn--danger { background: rgba(198, 40, 40, 0.1); color: var(--demo-error); border-color: rgba(198, 40, 40, 0.35); } .it-demo__btn--sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; } /* Поля ввода */ .it-demo__input, .it-demo__select, .it-demo__textarea { width: 100%; max-width: 100%; padding: 0.5rem 0.75rem; font-size: 0.875rem; font-family: inherit; color: var(--ifm-color-content); background: var(--ifm-background-color); border: 1px solid var(--demo-border); border-radius: 8px; transition: border-color 0.2s ease, box-shadow 0.2s ease; } .it-demo__input:focus, .it-demo__select:focus, .it-demo__textarea:focus { outline: none; border-color: var(--ifm-color-primary); box-shadow: 0 0 0 2px var(--demo-highlight); } .it-demo__label { display: block; margin-bottom: 0.35rem; font-size: 0.8rem; font-weight: 600; color: var(--demo-muted); } /* Терминал / код */ .it-demo__terminal { background: var(--demo-code-bg); color: var(--demo-code-fg); border: 1px solid var(--demo-border); border-radius: 8px; padding: var(--demo-pad); font-family: var(--ifm-font-family-monospace); font-size: clamp(0.75rem, 2vw, 0.85rem); line-height: 1.55; overflow-x: auto; max-width: 100%; white-space: pre-wrap; } .it-demo__terminal code { display: block; white-space: pre-wrap; word-break: break-word; background: transparent; color: inherit; padding: 0; border-radius: 0; font-size: inherit; } .it-demo__terminal pre { margin: 0; background: transparent; padding: 0; } .it-demo__line--active { background: var(--demo-highlight); border-radius: 4px; display: block; padding: 0.15rem 0.35rem; margin: 0.1rem 0; } /* Панели и вкладки */ .it-demo__panel { background: var(--ifm-background-surface-color); border: 1px solid var(--demo-border); border-radius: 8px; padding: var(--demo-pad); } .it-demo__tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; border-bottom: 1px solid var(--demo-border); margin-bottom: var(--demo-gap); padding-bottom: 0.35rem; } .it-demo__tab { padding: 0.4rem 0.85rem; font-size: 0.85rem; font-weight: 500; border: none; border-radius: 6px 6px 0 0; background: transparent; color: var(--demo-muted); cursor: pointer; font-family: inherit; } .it-demo__tab--active { background: var(--demo-highlight); color: var(--ifm-color-primary); font-weight: 600; } /* Алерты */ .it-demo__alert { padding: 0.85rem 1rem; border-radius: 8px; border-left: 4px solid; font-size: 0.875rem; line-height: 1.55; margin: var(--demo-gap) 0; } .it-demo__alert--info { border-left-color: var(--demo-info); background: rgba(123, 104, 238, 0.08); } .it-demo__alert--success { border-left-color: var(--demo-success); background: rgba(46, 125, 50, 0.08); } .it-demo__alert--warning { border-left-color: var(--demo-warning); background: rgba(237, 108, 2, 0.08); } .it-demo__alert--error { border-left-color: var(--demo-error); background: rgba(198, 40, 40, 0.08); } [data-theme='dark'] .it-demo__alert--info { background: rgba(147, 112, 219, 0.12); } /* Таблицы */ .it-demo__table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--demo-border); border-radius: 8px; } .it-demo__table { width: 100%; border-collapse: collapse; font-size: 0.85rem; } .it-demo__table th, .it-demo__table td { padding: 0.55rem 0.75rem; text-align: left; border-bottom: 1px solid var(--demo-border); } .it-demo__table th { background: var(--ifm-background-surface-color); font-weight: 600; color: var(--ifm-color-content); } .it-demo__table tr:last-child td { border-bottom: none; } /* Бейджи / статусы */ .it-demo__badge { display: inline-block; padding: 0.15rem 0.55rem; font-size: 0.75rem; font-weight: 600; border-radius: 999px; background: var(--ifm-background-surface-color); border: 1px solid var(--demo-border); color: var(--ifm-color-content); } .it-demo__badge--active { background: rgba(46, 125, 50, 0.12); border-color: rgba(46, 125, 50, 0.35); color: var(--demo-success); } .it-demo__badge--idle { color: var(--demo-muted); } /* Лог */ .it-demo__log { max-height: min(280px, 40vh); overflow-y: auto; font-family: var(--ifm-font-family-monospace); font-size: 0.8rem; line-height: 1.45; background: var(--ifm-background-surface-color); border: 1px solid var(--demo-border); border-radius: 8px; padding: 0.65rem; } .it-demo__log-entry { padding: 0.2rem 0; border-bottom: 1px solid var(--demo-border); word-break: break-word; } .it-demo__log-entry:last-child { border-bottom: none; } /* Визуализации (диаграммы, стеки) */ .it-demo__viz { min-height: 120px; padding: var(--demo-pad); background: var(--ifm-background-surface-color); border: 1px dashed var(--demo-border); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--demo-gap); } .it-demo__stack-item { padding: 0.5rem 1rem; background: var(--demo-surface); border: 2px solid var(--ifm-color-primary); border-radius: 6px; font-size: 0.85rem; font-weight: 500; text-align: center; transition: transform 0.25s ease, opacity 0.25s ease; } /* Прогресс */ .it-demo__progress { height: 8px; background: var(--ifm-background-surface-color); border-radius: 999px; overflow: hidden; border: 1px solid var(--demo-border); } .it-demo__progress-bar { height: 100%; background: linear-gradient( 90deg, var(--ifm-color-primary-dark), var(--ifm-color-primary) ); border-radius: 999px; transition: width 0.3s ease; } /* Степпер жизненного цикла */ .it-demo__steps { display: flex; flex-wrap: wrap; gap: 0.5rem; } .it-demo__step { flex: 1 1 auto; min-width: min(100%, 140px); padding: 0.65rem; text-align: center; border: 1px solid var(--demo-border); border-radius: 8px; font-size: 0.8rem; background: var(--ifm-background-surface-color); color: var(--demo-muted); cursor: pointer; font-family: inherit; transition: all 0.2s ease; } .it-demo__step--active { border-color: var(--ifm-color-primary); background: var(--demo-highlight); color: var(--ifm-color-primary); font-weight: 600; } .it-demo__step--done { border-color: var(--demo-success); color: var(--demo-success); } /* Placeholder до IntersectionObserver (витрины с многими демо на одной странице) */ .it-demo-lazy-host { min-height: 160px; contain: layout style; overflow-anchor: none; } /* Скелетон загрузки lazy */ .it-demo__skeleton { min-height: 160px; border-radius: var(--demo-radius); background: linear-gradient( 90deg, var(--ifm-background-surface-color) 25%, var(--demo-border) 50%, var(--ifm-background-surface-color) 75% ); background-size: 200% 100%; animation: it-demo-shimmer 1.2s ease-in-out infinite; } @keyframes it-demo-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } } @media (prefers-reduced-motion: reduce) { .it-demo__skeleton { animation: none; background: var(--ifm-background-surface-color); } .it-demo__btn:hover:not(:disabled) { transform: none; } } /* Ограниченная область для масштабируемого контента (в React предпочтительнее ZoomPanViewport) */ .it-demo__scroll-viewport { width: 100%; max-width: 100%; max-height: min(42vh, 280px); min-height: 160px; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }