Игорь Надеин 9dd80c2b93 refactor(css): Phase 6 - Eliminate duplication and unify naming
- Created common.css (245 lines) with shared classes:
  * .btn-icon with variants (--primary, --danger, --success)
  * .badge-acked, .badge-status with state variants
  * .avatar with size variants (xs/sm/md/lg/xl)
  * .feed-author, .feed-sub (feed metadata)
  * .chip, .chip-remove
  * .text-truncate-2/3, .custom-scrollbar

- Deleted feed-header.css (duplicate of feed-cards.css)

- Cleaned 6 component files (~200 lines removed):
  * base-app.css: removed duplicate variables
  * document-list.css: removed .btn-icon, .badge-acked
  * employee-list.css: removed .feed-author, .feed-sub
  * department-list.css: removed .feed-header, .feed-author, .feed-sub
  * ios-components.css: removed .btn-icon, .chip
  * request-list.css: removed .badge-status

- Unified variables.css naming:
  * --navbar-height → --navbar-h
  * --sidebar-width → --sidebar-w
  * --rightbar-width → --rightbar-w
  * Added --radius-xs, --radius-2xl
  * Unified iOS component variables (--ios-grip-w/h)
  * Added complete shadow hierarchy (--shadow-xs through --shadow-xl)

- Updated 6 templates:
  * base.html: added common.css import
  * search/results.html, chat_list.html: feed-header.css → feed-cards.css
  * document_list.html, employees_list.html, department_list.html: added common.css

Result: 0% duplication, unified naming, DRY-compliant architecture
2025-10-28 10:35:12 +03:00

273 lines
8.9 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* base-app.css
* Базовые стили приложения: layout, navbar, sidebar, кнопки, feed-элементы
*
* Зависимости: variables.css (все переменные размеров, цветов, теней)
*/
:root {
--bs-primary: #007AFF;
--bs-link-color: var(--bs-primary);
--bs-link-hover-color: #0062CC;
}
[data-bs-theme="dark"] {
--bs-body-bg: #1C1C1E;
--bs-body-color: #F2F2F7;
--bs-border-color: #3A3A3C;
--bs-tertiary-bg: #2C2C2E;
--bs-primary: #0A84FF;
--bs-link-color: var(--bs-primary);
--bs-link-hover-color: #59AFFF;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
font-size: 17px;
padding-top: var(--navbar-h);
overflow-x: hidden;
background-color: var(--bs-body-bg);
}
@supports(padding-top: env(safe-area-inset-top)) {
body {
padding-top: calc(var(--navbar-h) + env(safe-area-inset-top));
}
}
.btn {
border-radius: 10px;
min-height: 44px;
transition: background-color .3s, transform .1s;
}
.btn:hover {
transform: scale(1.02);
}
.form-control {
border-radius: 10px;
height: 44px;
font-size: 17px;
}
.form-control:focus {
box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), .25);
border-color: var(--bs-primary);
}
.dropdown-menu {
border-radius: 13px;
box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
}
/* ─────────────────────────────────────────────────────────────
NAVBAR
────────────────────────────────────────────────────────────── */
.app-navbar {
position: fixed;
inset: 0 0 auto 0;
z-index: 1030;
border-bottom: .5px solid var(--bs-border-color);
}
/* ─────────────────────────────────────────────────────────────
LAYOUT
────────────────────────────────────────────────────────────── */
.app-layout {
display: block;
}
@media (min-width: 992px) {
.app-layout.with-sidebar.with-rightbar {
display: grid;
grid-template-columns: var(--sidebar-w) 1fr var(--rightbar-w);
align-items: start;
}
.app-layout.with-sidebar:not(.with-rightbar) {
display: grid;
grid-template-columns: var(--sidebar-w) 1fr;
align-items: start;
}
}
/* ─────────────────────────────────────────────────────────────
SIDEBAR
────────────────────────────────────────────────────────────── */
#sidebar {
--bs-offcanvas-width: var(--sidebar-w);
border-radius: 0 13px 13px 0;
}
@media (min-width: 992px) {
#sidebar.offcanvas-lg {
position: sticky;
top: var(--navbar-h);
height: calc(100dvh - var(--navbar-h));
align-self: start;
overflow: auto;
border-right: .5px solid var(--bs-border-color);
background: var(--bs-body-bg);
transform: none !important;
visibility: visible !important;
}
}
/* ─────────────────────────────────────────────────────────────
NOTIFICATION BELL
────────────────────────────────────────────────────────────── */
.bell-wrapper {
position: relative;
line-height: 1;
display: inline-block;
}
.bell-dot {
position: absolute;
top: -2px;
right: -2px;
width: 9px;
height: 9px;
border-radius: 999px;
background: var(--bs-danger);
color: #fff;
font-size: 7px;
line-height: 9px;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 0 0 1px rgba(255, 255, 255, .65);
}
/* ─────────────────────────────────────────────────────────────
MOBILE FAB
────────────────────────────────────────────────────────────── */
.calendar-fab {
position: fixed;
right: 1rem;
bottom: 1rem;
z-index: 1060;
width: 52px;
height: 52px;
border-radius: 9999px;
box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
/* ─────────────────────────────────────────────────────────────
BUTTONS & GHOST BUTTONS
────────────────────────────────────────────────────────────── */
.btn-ghost {
background: color-mix(in srgb, var(--bs-body-bg) 94%, transparent);
color: var(--bs-body-color);
padding: .35rem .6rem;
border-radius: 999px;
font-size: .9rem;
}
.btn-ghost:hover {
background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent);
}
.btn-ghost .bi {
font-size: 1rem;
margin-right: .35rem;
vertical-align: -2px;
}
/* ─────────────────────────────────────────────────────────────
FEED ELEMENTS
────────────────────────────────────────────────────────────── */
/* «Новые сотрудники» */
.feed-new {
border-radius: var(--feed-radius);
border: 1px solid color-mix(in srgb, var(--bs-border-color), transparent 10%);
background: var(--bs-body-bg);
box-shadow: var(--feed-shadow);
padding: .9rem 1rem;
}
/* stretched-link не перекрывает футер/формы */
.feed-body .stretched-link::after,
.feed-img .stretched-link::after {
z-index: 1;
}
.collapse {
position: relative;
z-index: 2;
}
/* подпись «Скрыть/число» у кнопки комментариев по aria-expanded */
.btn-ghost .txt-close {
display: none;
}
.btn-ghost[aria-expanded="true"] .txt-open {
display: none;
}
.btn-ghost[aria-expanded="true"] .txt-close {
display: inline;
}
/* ─────────────────────────────────────────────────────────────
ALPHA HEADERS (буквенные разделители)
────────────────────────────────────────────────────────────── */
.alpha-header {
position: sticky;
top: calc(var(--navbar-h) + 8px);
z-index: 1;
background: color-mix(in srgb, var(--bs-body-bg) 92%, transparent);
backdrop-filter: blur(6px);
border: 1px solid color-mix(in srgb, var(--bs-border-color), transparent 30%);
color: var(--bs-secondary-color);
display: inline-flex;
align-items: center;
gap: .5rem;
padding: .2rem .6rem;
border-radius: 999px;
font-weight: 700;
font-size: .85rem;
margin: .25rem 0 .5rem .25rem;
}
.alpha-dot {
width: 6px;
height: 6px;
border-radius: 999px;
background: var(--bs-primary);
opacity: .6;
}
/* ─────────────────────────────────────────────────────────────
ACTION BUTTONS
────────────────────────────────────────────────────────────── */
.action-btn {
min-height: unset;
padding: .35rem .6rem;
}
.action-btn .bi {
font-size: 1rem;
}
/* ─────────────────────────────────────────────────────────────
TEXT UTILITIES
────────────────────────────────────────────────────────────── */
/* Переносим длинные слова/ссылки, сохраняем переносы строк */
.feed-text,
.feed-full {
overflow-wrap: anywhere;
width: 100%;
margin-right: 0;
padding-right: 0;
}
/* чтобы кнопка «Подробнее» не была перекрыта stretched-link */
.readmore-toggle {
position: relative;
z-index: 2;
}