From b3f521c20caa5701c9340db4707ac21b02b84f87 Mon Sep 17 00:00:00 2001 From: "d.a.kolesov" Date: Thu, 30 Jul 2026 08:20:06 +0700 Subject: [PATCH] material3 --- CLAUDE.md | 38 ++ package-lock.json | 497 +----------------- package.json | 1 + src/renderer/src/assets/styles/base.css | 53 ++ .../src/assets/styles/material3-tokens.css | 208 ++++++++ src/renderer/src/components/ColorPicker.vue | 68 +++ src/renderer/src/components/CustomSelect.vue | 51 ++ src/renderer/src/components/Switch.vue | 97 ++++ src/renderer/src/components/UpdateBanner.vue | 50 ++ .../components/accounts/AddAccountDialog.vue | 240 +++++++++ .../components/accounts/EditAccountDialog.vue | 215 ++++++++ .../src/components/calendar/EventBlock.vue | 52 ++ .../components/calendar/EventDetailPopup.vue | 189 +++++++ .../src/components/calendar/MiniCalendar.vue | 118 +++++ .../src/components/calendar/WeekView.vue | 150 +++++- .../src/components/layout/AppShell.vue | 89 ++++ .../src/components/layout/StatusBar.vue | 10 + .../src/components/layout/TitleBar.vue | 23 + .../src/components/messages/MessageList.vue | 224 ++++++++ .../components/messages/MessageListItem.vue | 88 ++++ .../components/messages/ThreadContextMenu.vue | 24 + .../components/messages/ThreadListItem.vue | 123 +++++ .../notifications/NotificationToast.vue | 42 ++ .../components/preview/AttachmentStrip.vue | 63 +++ .../src/components/preview/MessageBody.vue | 8 + .../src/components/preview/MessageHeader.vue | 148 ++++++ .../src/components/preview/MessagePreview.vue | 12 + .../components/sidebar/AccountSwitcher.vue | 56 ++ .../components/sidebar/FolderContextMenu.vue | 29 + .../src/components/sidebar/FolderTree.vue | 17 + .../src/components/sidebar/FolderTreeItem.vue | 90 ++++ src/renderer/src/main.ts | 1 + src/renderer/src/stores/settings.store.ts | 62 ++- src/renderer/src/utils/color.ts | 15 + src/renderer/src/utils/material3-theme.ts | 91 ++++ src/renderer/src/views/CalendarView.vue | 201 +++++++ src/renderer/src/views/ComposeView.vue | 271 ++++++++++ src/renderer/src/views/SettingsView.vue | 252 ++++++++- 38 files changed, 3475 insertions(+), 491 deletions(-) create mode 100644 src/renderer/src/assets/styles/material3-tokens.css create mode 100644 src/renderer/src/components/Switch.vue create mode 100644 src/renderer/src/utils/color.ts create mode 100644 src/renderer/src/utils/material3-theme.ts diff --git a/CLAUDE.md b/CLAUDE.md index 37f7c84..45da5bf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -104,3 +104,41 @@ see the updated count and skip the second notification. `notifications.store.ts` stores muted folders in `localStorage` (`muted-folders` key). Mute is per `accountId:folderId`, supports duration (ms) or permanent (`null`). Mute check walks up the folder parent chain — muting a parent silences all children. + +## Design system (Liquid Glass / Material 3) — `:global()` scoped-CSS gotcha + +`settings.store.ts` has `designSystem: 'liquid-glass' | 'material3'`, toggled in Settings +("Дизайн"). It sets `document.documentElement.dataset.design`, and `material3-theme.ts` +generates the full M3 color-role set (`--md-sys-color-*`) from a seed color via +`@material/material-color-utilities` (HCT/dynamic color, dark scheme only). +`material3-tokens.css` holds the static tokens (typescale/shape/elevation/motion) and remaps +the app's shared aliases (`--accent`, `--text-*`, `--radius-*`, `--glass-*`, `--shadow-*`) to +M3 roles, plus force-kills every `backdrop-filter` under `html[data-design='material3']`. + +Per-component M3 overrides live at the bottom of each component's own ` @@ -381,4 +413,40 @@ onUnmounted(() => document.removeEventListener('mousedown', onDocClick)) inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); } + +/* ── Material 3 ── */ +html[data-design='material3'] .cp-panel { + background: var(--md-sys-color-surface-container-high); + border: 1px solid var(--md-sys-color-outline-variant); + border-radius: var(--md-sys-shape-corner-medium); + box-shadow: var(--md-sys-elevation-2); +} + +html[data-design='material3'] .cp-sb { + box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant); + border-radius: var(--md-sys-shape-corner-extra-small); +} + +html[data-design='material3'] .cp-hue { + border-radius: var(--md-sys-shape-corner-full); + box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .cp-preview { + border: 1.5px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} + +html[data-design='material3'] .cp-hex-input { + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline); + border-radius: var(--md-sys-shape-corner-small); + color: var(--md-sys-color-on-surface); + box-shadow: none; +} + +html[data-design='material3'] .cp-hex-input:focus { + border-color: var(--md-sys-color-primary); + box-shadow: 0 0 0 1px var(--md-sys-color-primary); +} diff --git a/src/renderer/src/components/CustomSelect.vue b/src/renderer/src/components/CustomSelect.vue index 7495916..d6e5603 100644 --- a/src/renderer/src/components/CustomSelect.vue +++ b/src/renderer/src/components/CustomSelect.vue @@ -157,6 +157,30 @@ onUnmounted(() => document.removeEventListener('mousedown', onDocClick)) .select-arrow.rotated { transform: rotate(180deg); } + +/* ── Material 3 (Text field trigger) ── */ +html[data-design='material3'] .select-trigger { + border-radius: var(--md-sys-shape-corner-small); + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline); + box-shadow: none; + font-size: var(--md-sys-typescale-body-large-size); +} + +html[data-design='material3'] .select-trigger:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-highest)); + border-color: var(--md-sys-color-outline); + box-shadow: none; +} + +html[data-design='material3'] .open .select-trigger { + border-color: var(--md-sys-color-primary); + box-shadow: 0 0 0 1px var(--md-sys-color-primary); +} + +html[data-design='material3'] .select-arrow { + color: var(--md-sys-color-on-surface-variant); +} @@ -208,4 +232,31 @@ onUnmounted(() => document.removeEventListener('mousedown', onDocClick)) justify-content: center; color: var(--accent); } + +/* ── Material 3 (Menu) ── */ +html[data-design='material3'] .select-dropdown { + background: var(--md-sys-color-surface-container); + border: 1px solid var(--md-sys-color-outline-variant); + border-radius: var(--md-sys-shape-corner-small); + box-shadow: var(--md-sys-elevation-2); +} + +html[data-design='material3'] .select-option { + border-radius: var(--md-sys-shape-corner-extra-small); + font-size: var(--md-sys-typescale-body-medium-size); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .select-option:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .select-option.active { + color: var(--md-sys-color-primary); +} + +html[data-design='material3'] .option-check { + color: var(--md-sys-color-primary); +} diff --git a/src/renderer/src/components/Switch.vue b/src/renderer/src/components/Switch.vue new file mode 100644 index 0000000..8ccb067 --- /dev/null +++ b/src/renderer/src/components/Switch.vue @@ -0,0 +1,97 @@ + + + + + diff --git a/src/renderer/src/components/UpdateBanner.vue b/src/renderer/src/components/UpdateBanner.vue index c3b9134..38bf3e6 100644 --- a/src/renderer/src/components/UpdateBanner.vue +++ b/src/renderer/src/components/UpdateBanner.vue @@ -176,4 +176,54 @@ const updater = useUpdaterStore() opacity: 0; transform: translateX(-50%) translateY(12px); } + +/* ── Material 3 ── */ +html[data-design='material3'] .banner-body { + background: var(--md-sys-color-primary-container); + border: none; + border-radius: var(--md-sys-shape-corner-extra-small); + box-shadow: var(--md-sys-elevation-2); +} + +html[data-design='material3'] .banner-icon { + color: var(--md-sys-color-on-primary-container); +} + +html[data-design='material3'] .banner-title { + color: var(--md-sys-color-on-primary-container); + font-size: var(--md-sys-typescale-title-small-size); + font-weight: var(--md-sys-typescale-title-small-weight); +} + +html[data-design='material3'] .banner-sub { + color: color-mix(in srgb, var(--md-sys-color-on-primary-container) 75%, transparent); + font-size: var(--md-sys-typescale-body-small-size); +} + +html[data-design='material3'] .banner-progress-wrap { + background: color-mix(in srgb, var(--md-sys-color-on-primary-container) 20%, transparent); + border-radius: 0 0 var(--md-sys-shape-corner-extra-small) var(--md-sys-shape-corner-extra-small); +} + +html[data-design='material3'] .banner-progress-bar { + background: var(--md-sys-color-primary); + border-radius: 0 0 var(--md-sys-shape-corner-extra-small) var(--md-sys-shape-corner-extra-small); +} + +html[data-design='material3'] .btn-primary { + background: var(--md-sys-color-primary); + color: var(--md-sys-color-on-primary); + border-radius: var(--md-sys-shape-corner-full); + font-size: var(--md-sys-typescale-label-large-size); + font-weight: var(--md-sys-typescale-label-large-weight); +} + +html[data-design='material3'] .btn-dismiss { + color: var(--md-sys-color-on-primary-container); +} + +html[data-design='material3'] .btn-dismiss:hover { + background: color-mix(in srgb, var(--md-sys-color-on-primary-container) 12%, transparent); + color: var(--md-sys-color-on-primary-container); +} diff --git a/src/renderer/src/components/accounts/AddAccountDialog.vue b/src/renderer/src/components/accounts/AddAccountDialog.vue index 13a9de4..fb630b3 100644 --- a/src/renderer/src/components/accounts/AddAccountDialog.vue +++ b/src/renderer/src/components/accounts/AddAccountDialog.vue @@ -888,4 +888,244 @@ const providerName = computed(() => detectedPreset.value?.name ?? 'IMAP') color: var(--text-muted); margin: 0; } + +/* ══════════════════════════════════════════════════════════════════════════ + Material Design 3 — переопределения (активны только под data-design=material3) + ══════════════════════════════════════════════════════════════════════════ */ + +/* Overlay — скрим вместо стеклянного затемнения */ +html[data-design='material3'] .dialog-overlay { + background: color-mix(in srgb, var(--md-sys-color-scrim) 32%, transparent); +} + +/* Модальный диалог — elevation-3, extra-large shape, surface-container-high */ +html[data-design='material3'] .dialog { + background: var(--md-sys-color-surface-container-high); + border-radius: var(--md-sys-shape-corner-extra-large); + box-shadow: var(--md-sys-elevation-3); +} + +html[data-design='material3'] .dialog::before { + display: none; +} + +html[data-design='material3'] .dialog-header { + background: transparent; + border-bottom: 1px solid var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .header-avatar { + background: var(--md-sys-color-primary-container); + border: none; + box-shadow: none; + color: var(--md-sys-color-on-primary-container); +} + +/* Заголовок диалога — headline-small согласно контракту */ +html[data-design='material3'] .header-text h2 { + font-size: var(--md-sys-typescale-headline-small-size); + line-height: var(--md-sys-typescale-headline-small-line); + font-weight: var(--md-sys-typescale-headline-small-weight); + letter-spacing: var(--md-sys-typescale-headline-small-tracking); +} + +html[data-design='material3'] .close-btn { + background: transparent; + border: none; + box-shadow: none; + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .close-btn:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .dialog-body { + scrollbar-color: var(--md-sys-color-outline-variant) transparent; +} + +/* Предупреждение о keychain — тонированный tertiary (у M3 нет отдельной warning-роли) */ +html[data-design='material3'] .warn-msg { + background: var(--md-sys-color-tertiary-container); + border: 1px solid transparent; + color: var(--md-sys-color-on-tertiary-container); +} + +html[data-design='material3'] .error-msg { + background: var(--md-sys-color-error-container); + border: 1px solid transparent; + color: var(--md-sys-color-on-error-container); +} + +/* Подписи полей формы — body-small согласно контракту */ +html[data-design='material3'] .form-group label:not(.checkbox-label):not(.toggle-switch) { + color: var(--md-sys-color-on-surface-variant); + font-size: var(--md-sys-typescale-body-small-size); + line-height: var(--md-sys-typescale-body-small-line); + font-weight: var(--md-sys-typescale-body-small-weight); + letter-spacing: var(--md-sys-typescale-body-small-tracking); + text-transform: none; +} + +/* Текстовые поля — Outlined text field, shape small */ +html[data-design='material3'] .form-group input[type="text"], +html[data-design='material3'] .form-group input[type="password"], +html[data-design='material3'] .form-group input[type="number"] { + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline); + border-top-color: var(--md-sys-color-outline); + color: var(--md-sys-color-on-surface); + box-shadow: none; + border-radius: var(--md-sys-shape-corner-small); +} + +html[data-design='material3'] .form-group input:focus { + background: var(--md-sys-color-surface-container-highest); + border-color: var(--md-sys-color-primary); + border-top-color: var(--md-sys-color-primary); + box-shadow: 0 0 0 1px var(--md-sys-color-primary); +} + +html[data-design='material3'] .section-sep::before, +html[data-design='material3'] .section-sep::after { + background: var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .section-label-text { + font-size: var(--md-sys-typescale-label-small-size); + line-height: var(--md-sys-typescale-label-small-line); + font-weight: var(--md-sys-typescale-label-small-weight); + letter-spacing: var(--md-sys-typescale-label-small-tracking); + color: var(--md-sys-color-on-surface-variant); + text-transform: none; +} + +/* Переключатель SSL/TLS */ +html[data-design='material3'] .toggle-track { + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline); + box-shadow: none; +} + +html[data-design='material3'] .toggle-track::after { + background: var(--md-sys-color-outline); + box-shadow: none; +} + +html[data-design='material3'] .toggle-switch input:checked + .toggle-track { + background: var(--md-sys-color-primary); + border-color: var(--md-sys-color-primary); + box-shadow: none; +} + +html[data-design='material3'] .toggle-switch input:checked + .toggle-track::after { + background: var(--md-sys-color-on-primary); +} + +/* Чекбокс "самоподписанные сертификаты" */ +html[data-design='material3'] .checkbox-label { + font-size: var(--md-sys-typescale-body-small-size); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .checkbox-label input[type="checkbox"] { + background: transparent; + border: 2px solid var(--md-sys-color-outline); + border-top-color: var(--md-sys-color-outline); + box-shadow: none; + border-radius: var(--md-sys-shape-corner-extra-small); +} + +html[data-design='material3'] .checkbox-label input[type="checkbox"]:checked { + background: var(--md-sys-color-primary); + border-color: var(--md-sys-color-primary); +} + +html[data-design='material3'] .checkbox-label input[type="checkbox"]:checked::after { + border-color: var(--md-sys-color-on-primary); + border-top: none; + border-left: none; +} + +/* Кнопка отправки формы — Filled button, полная форма, label-large */ +html[data-design='material3'] .submit-btn { + border-radius: var(--md-sys-shape-corner-full); + font-size: var(--md-sys-typescale-label-large-size); + font-weight: var(--md-sys-typescale-label-large-weight); + letter-spacing: var(--md-sys-typescale-label-large-tracking); + box-shadow: none; +} + +html[data-design='material3'] .submit-btn:hover:not(:disabled) { + box-shadow: var(--md-sys-elevation-1); +} + +/* Проверка подключения — строки статусов через контейнерные роли */ +html[data-design='material3'] .check-row { + background: var(--md-sys-color-surface-container); + border: 1px solid var(--md-sys-color-outline-variant); + border-radius: var(--md-sys-shape-corner-medium); +} + +html[data-design='material3'] .check-row.ok { + background: var(--md-sys-color-tertiary-container); + border-color: transparent; +} + +html[data-design='material3'] .check-row.ok .check-label, +html[data-design='material3'] .check-row.ok .check-detail { + color: var(--md-sys-color-on-tertiary-container); +} + +html[data-design='material3'] .check-row.error { + background: var(--md-sys-color-error-container); + border-color: transparent; +} + +html[data-design='material3'] .check-row.error .check-label, +html[data-design='material3'] .check-row.error .check-detail { + color: var(--md-sys-color-on-error-container); +} + +html[data-design='material3'] .check-icon { + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .check-spinner { + border: 2px solid var(--md-sys-color-outline-variant); + border-top-color: var(--md-sys-color-primary); +} + +html[data-design='material3'] .check-idle { + background: var(--md-sys-color-outline-variant); +} + +/* Экран успеха */ +html[data-design='material3'] .success-check { + background: var(--md-sys-color-primary-container); + border: none; + box-shadow: none; + color: var(--md-sys-color-on-primary-container); +} + +html[data-design='material3'] .success-title { + font-size: var(--md-sys-typescale-title-medium-size); + line-height: var(--md-sys-typescale-title-medium-line); + font-weight: var(--md-sys-typescale-title-medium-weight); + letter-spacing: var(--md-sys-typescale-title-medium-tracking); +} + +html[data-design='material3'] .success-account { + background: var(--md-sys-color-surface-container); + border: 1px solid var(--md-sys-color-outline-variant); + border-radius: var(--md-sys-shape-corner-medium); +} + +html[data-design='material3'] .success-avatar { + background: var(--md-sys-color-primary-container); + border: none; + color: var(--md-sys-color-on-primary-container); +} diff --git a/src/renderer/src/components/accounts/EditAccountDialog.vue b/src/renderer/src/components/accounts/EditAccountDialog.vue index efdea39..82b1626 100644 --- a/src/renderer/src/components/accounts/EditAccountDialog.vue +++ b/src/renderer/src/components/accounts/EditAccountDialog.vue @@ -693,4 +693,219 @@ const isFormValid = computed(() => email.value.trim() && imapHost.value && smtpH .check-label { font-size: 13px; font-weight: 600; color: var(--text-primary); } .check-detail { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); } + +/* ══════════════════════════════════════════════════════════════════════════ + Material Design 3 — переопределения (активны только под data-design=material3) + ══════════════════════════════════════════════════════════════════════════ */ + +/* Overlay — скрим вместо стеклянного затемнения */ +html[data-design='material3'] .dialog-overlay { + background: color-mix(in srgb, var(--md-sys-color-scrim) 32%, transparent); +} + +/* Модальный диалог — elevation-3, extra-large shape, surface-container-high */ +html[data-design='material3'] .dialog { + background: var(--md-sys-color-surface-container-high); + border-radius: var(--md-sys-shape-corner-extra-large); + box-shadow: var(--md-sys-elevation-3); +} + +html[data-design='material3'] .dialog::before { + display: none; +} + +html[data-design='material3'] .dialog-header { + background: transparent; + border-bottom: 1px solid var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .header-avatar { + background: var(--md-sys-color-primary-container); + border: none; + box-shadow: none; + color: var(--md-sys-color-on-primary-container); +} + +/* Заголовок диалога — headline-small согласно контракту */ +html[data-design='material3'] .header-text h2 { + font-size: var(--md-sys-typescale-headline-small-size); + line-height: var(--md-sys-typescale-headline-small-line); + font-weight: var(--md-sys-typescale-headline-small-weight); + letter-spacing: var(--md-sys-typescale-headline-small-tracking); +} + +html[data-design='material3'] .header-sub { + font-size: var(--md-sys-typescale-body-small-size); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .close-btn { + background: transparent; + border: none; + box-shadow: none; + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .close-btn:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .dialog-body { + scrollbar-color: var(--md-sys-color-outline-variant) transparent; +} + +html[data-design='material3'] .error-msg { + background: var(--md-sys-color-error-container); + border: 1px solid transparent; + color: var(--md-sys-color-on-error-container); +} + +/* Подписи полей формы — body-small согласно контракту */ +html[data-design='material3'] .form-group label:not(.checkbox-label):not(.toggle-switch) { + color: var(--md-sys-color-on-surface-variant); + font-size: var(--md-sys-typescale-body-small-size); + line-height: var(--md-sys-typescale-body-small-line); + font-weight: var(--md-sys-typescale-body-small-weight); + letter-spacing: var(--md-sys-typescale-body-small-tracking); + text-transform: none; +} + +html[data-design='material3'] .field-hint { + color: var(--md-sys-color-on-surface-variant); +} + +/* Текстовые поля — Outlined text field, shape small */ +html[data-design='material3'] .form-group input[type="text"], +html[data-design='material3'] .form-group input[type="password"], +html[data-design='material3'] .form-group input[type="number"] { + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline); + border-top-color: var(--md-sys-color-outline); + color: var(--md-sys-color-on-surface); + box-shadow: none; + border-radius: var(--md-sys-shape-corner-small); +} + +html[data-design='material3'] .form-group input:focus { + background: var(--md-sys-color-surface-container-highest); + border-color: var(--md-sys-color-primary); + border-top-color: var(--md-sys-color-primary); + box-shadow: 0 0 0 1px var(--md-sys-color-primary); +} + +html[data-design='material3'] .section-sep::before, +html[data-design='material3'] .section-sep::after { + background: var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .section-label-text { + font-size: var(--md-sys-typescale-label-small-size); + line-height: var(--md-sys-typescale-label-small-line); + font-weight: var(--md-sys-typescale-label-small-weight); + letter-spacing: var(--md-sys-typescale-label-small-tracking); + color: var(--md-sys-color-on-surface-variant); + text-transform: none; +} + +/* Переключатель SSL/TLS */ +html[data-design='material3'] .toggle-track { + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline); + box-shadow: none; +} + +html[data-design='material3'] .toggle-track::after { + background: var(--md-sys-color-outline); + box-shadow: none; +} + +html[data-design='material3'] .toggle-switch input:checked + .toggle-track { + background: var(--md-sys-color-primary); + border-color: var(--md-sys-color-primary); + box-shadow: none; +} + +html[data-design='material3'] .toggle-switch input:checked + .toggle-track::after { + background: var(--md-sys-color-on-primary); +} + +/* Чекбокс "самоподписанные сертификаты" */ +html[data-design='material3'] .checkbox-label { + font-size: var(--md-sys-typescale-body-small-size); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .checkbox-label input[type="checkbox"] { + background: transparent; + border: 2px solid var(--md-sys-color-outline); + border-top-color: var(--md-sys-color-outline); + box-shadow: none; + border-radius: var(--md-sys-shape-corner-extra-small); +} + +html[data-design='material3'] .checkbox-label input[type="checkbox"]:checked { + background: var(--md-sys-color-primary); + border-color: var(--md-sys-color-primary); +} + +html[data-design='material3'] .checkbox-label input[type="checkbox"]:checked::after { + border-color: var(--md-sys-color-on-primary); + border-top: none; + border-left: none; +} + +/* Кнопка сохранения — Filled button, полная форма, label-large */ +html[data-design='material3'] .submit-btn { + border-radius: var(--md-sys-shape-corner-full); + font-size: var(--md-sys-typescale-label-large-size); + font-weight: var(--md-sys-typescale-label-large-weight); + letter-spacing: var(--md-sys-typescale-label-large-tracking); + box-shadow: none; +} + +html[data-design='material3'] .submit-btn:hover:not(:disabled) { + box-shadow: var(--md-sys-elevation-1); +} + +/* Проверка подключения — строки статусов через контейнерные роли */ +html[data-design='material3'] .check-row { + background: var(--md-sys-color-surface-container); + border: 1px solid var(--md-sys-color-outline-variant); + border-radius: var(--md-sys-shape-corner-medium); +} + +html[data-design='material3'] .check-row.ok { + background: var(--md-sys-color-tertiary-container); + border-color: transparent; +} + +html[data-design='material3'] .check-row.ok .check-label, +html[data-design='material3'] .check-row.ok .check-detail { + color: var(--md-sys-color-on-tertiary-container); +} + +html[data-design='material3'] .check-row.error { + background: var(--md-sys-color-error-container); + border-color: transparent; +} + +html[data-design='material3'] .check-row.error .check-label, +html[data-design='material3'] .check-row.error .check-detail { + color: var(--md-sys-color-on-error-container); +} + +html[data-design='material3'] .check-icon { + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .check-spinner { + border: 2px solid var(--md-sys-color-outline-variant); + border-top-color: var(--md-sys-color-primary); +} + +html[data-design='material3'] .check-idle { + background: var(--md-sys-color-outline-variant); +} diff --git a/src/renderer/src/components/calendar/EventBlock.vue b/src/renderer/src/components/calendar/EventBlock.vue index 32669da..48f36b0 100644 --- a/src/renderer/src/components/calendar/EventBlock.vue +++ b/src/renderer/src/components/calendar/EventBlock.vue @@ -198,4 +198,56 @@ const statusClass = computed(() => { color: var(--ev-color); opacity: 0.7; } + +/* ── Material 3 ── */ +/* Компактные блоки (< 45 мин) — small shape, обычные — medium (M3: событие как маленькая карточка) */ +html[data-design='material3'] .event-block { + border-radius: var(--md-sys-shape-corner-small); + background: color-mix(in srgb, var(--ev-color) 22%, var(--md-sys-color-surface-container-high)); + border: 1px solid color-mix(in srgb, var(--ev-color) 40%, var(--md-sys-color-outline-variant)); + border-top-color: color-mix(in srgb, var(--ev-color) 40%, var(--md-sys-color-outline-variant)); + box-shadow: none; +} + +html[data-design='material3'] .event-block:not(.event-short) { + border-radius: var(--md-sys-shape-corner-medium); +} + +html[data-design='material3'] .event-block::before { + border-radius: var(--md-sys-shape-corner-small) 0 0 var(--md-sys-shape-corner-small); +} + +html[data-design='material3'] .event-block:hover { + transform: none; + filter: none; + background: color-mix(in srgb, var(--ev-color) 30%, var(--md-sys-color-surface-container-high)); + box-shadow: none; +} + +html[data-design='material3'] .ev-specular { + display: none; +} + +html[data-design='material3'] .ev-title { + font-size: var(--md-sys-typescale-label-medium-size); + line-height: var(--md-sys-typescale-label-medium-line); + font-weight: var(--md-sys-typescale-label-medium-weight); + letter-spacing: var(--md-sys-typescale-label-medium-tracking); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .event-short .ev-title { + font-size: var(--md-sys-typescale-label-small-size); + line-height: var(--md-sys-typescale-label-small-line); +} + +html[data-design='material3'] .ev-time { + font-size: var(--md-sys-typescale-label-small-size); + line-height: var(--md-sys-typescale-label-small-line); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .ev-location { + color: var(--md-sys-color-on-surface-variant); +} diff --git a/src/renderer/src/components/calendar/EventDetailPopup.vue b/src/renderer/src/components/calendar/EventDetailPopup.vue index feaee56..bcf5c84 100644 --- a/src/renderer/src/components/calendar/EventDetailPopup.vue +++ b/src/renderer/src/components/calendar/EventDetailPopup.vue @@ -557,4 +557,193 @@ async function copyEmail(email: string) { font-size:13px; color:rgba(255,255,255,0.52); white-space:pre-wrap; line-height:1.7; margin:0; word-break:break-word; } + +/* ── Material 3 ── */ +/* Центрированное модальное окно → dialog-паттерн, extra-large shape, elevation-3 */ + +html[data-design='material3'] .backdrop { + background: color-mix(in srgb, var(--md-sys-color-scrim) 46%, transparent); +} + +html[data-design='material3'] .popup { + border-radius: var(--md-sys-shape-corner-extra-large); + background: var(--md-sys-color-surface-container-high); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: var(--md-sys-elevation-3); + scrollbar-color: var(--md-sys-color-outline-variant) transparent; +} + +html[data-design='material3'] .popup::-webkit-scrollbar-thumb { + background: var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .specular { + display: none; +} + +html[data-design='material3'] .hero-wash { + display: none; +} + +html[data-design='material3'] .hero::after { + background: var(--md-sys-color-outline-variant); + height: 1px; +} + +html[data-design='material3'] .close-btn { + border-radius: var(--md-sys-shape-corner-full); + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline-variant); + color: var(--md-sys-color-on-surface-variant); +} +html[data-design='material3'] .close-btn:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-highest)); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .evt-badge { + background: color-mix(in srgb, var(--sc) 18%, var(--md-sys-color-surface-container-high)); + border: 1px solid color-mix(in srgb, var(--sc) 30%, var(--md-sys-color-outline-variant)); + border-radius: var(--md-sys-shape-corner-full); +} + +html[data-design='material3'] .hero-title { + color: var(--md-sys-color-on-surface); + font-size: var(--md-sys-typescale-headline-small-size); + line-height: var(--md-sys-typescale-headline-small-line); + font-weight: var(--md-sys-typescale-headline-small-weight); + letter-spacing: var(--md-sys-typescale-headline-small-tracking); +} + +html[data-design='material3'] .hero-date, +html[data-design='material3'] .hero-dur { + font-size: var(--md-sys-typescale-body-medium-size); + line-height: var(--md-sys-typescale-body-medium-line); +} + +html[data-design='material3'] .hero-date { + color: var(--md-sys-color-on-surface-variant); +} +html[data-design='material3'] .hero-bull { + color: var(--md-sys-color-outline); +} +html[data-design='material3'] .hero-dur { + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .card { + background: var(--md-sys-color-surface-container); + border: 1px solid var(--md-sys-color-outline-variant); + border-radius: var(--md-sys-shape-corner-large); +} + +html[data-design='material3'] .row-icon { + border-radius: var(--md-sys-shape-corner-small); + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline-variant); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .row-label, +html[data-design='material3'] .pgroup-head { + font-size: var(--md-sys-typescale-label-small-size); + line-height: var(--md-sys-typescale-label-small-line); + font-weight: var(--md-sys-typescale-label-small-weight); + letter-spacing: var(--md-sys-typescale-label-small-tracking); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .row-value { + font-size: var(--md-sys-typescale-body-medium-size); + line-height: var(--md-sys-typescale-body-medium-line); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .loc-link { + color: var(--md-sys-color-primary); + text-decoration-color: color-mix(in srgb, var(--md-sys-color-primary) 45%, transparent); +} +html[data-design='material3'] .loc-link:hover { + color: var(--md-sys-color-primary); + text-decoration-color: var(--md-sys-color-primary); +} + +html[data-design='material3'] .psep { + background: var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .chevron-btn { + border-radius: var(--md-sys-shape-corner-small); + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline-variant); + color: var(--md-sys-color-on-surface-variant); +} +html[data-design='material3'] .chevron-btn:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-highest)); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .ava { + background: color-mix(in srgb, var(--ac) 30%, var(--md-sys-color-surface-container-highest)); + border: 1.5px solid color-mix(in srgb, var(--ac) 40%, var(--md-sys-color-outline-variant)); + color: color-mix(in srgb, var(--ac) 85%, var(--md-sys-color-on-surface) 15%); +} + +html[data-design='material3'] .ava-status-dot { + box-shadow: 0 0 0 1.5px var(--md-sys-color-surface-container); +} + +html[data-design='material3'] .stack-ava { + box-shadow: 0 0 0 2px var(--md-sys-color-surface-container); +} + +html[data-design='material3'] .stack-more { + background: var(--md-sys-color-surface-container-highest); + border-color: var(--md-sys-color-outline-variant); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .plist .prow:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 6%, transparent); +} + +html[data-design='material3'] .pname { + font-size: var(--md-sys-typescale-body-medium-size); + line-height: var(--md-sys-typescale-body-medium-line); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .optional-tag { + font-size: var(--md-sys-typescale-label-small-size); + border-radius: var(--md-sys-shape-corner-extra-small); + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline-variant); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .pemail { + font-size: var(--md-sys-typescale-body-small-size); + line-height: var(--md-sys-typescale-body-small-line); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .copy-btn { + color: var(--md-sys-color-on-surface-variant); +} +html[data-design='material3'] .copy-btn:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + border-color: var(--md-sys-color-outline-variant); + color: var(--md-sys-color-on-surface); +} +html[data-design='material3'] .copy-btn.ok { + color: var(--md-sys-color-primary); + background: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent); + border-color: color-mix(in srgb, var(--md-sys-color-primary) 25%, transparent); +} + +html[data-design='material3'] .desc-text { + font-size: var(--md-sys-typescale-body-medium-size); + line-height: var(--md-sys-typescale-body-medium-line); + color: var(--md-sys-color-on-surface-variant); +} diff --git a/src/renderer/src/components/calendar/MiniCalendar.vue b/src/renderer/src/components/calendar/MiniCalendar.vue index 6de7a20..d8b48cb 100644 --- a/src/renderer/src/components/calendar/MiniCalendar.vue +++ b/src/renderer/src/components/calendar/MiniCalendar.vue @@ -365,4 +365,122 @@ function nextMonth(): void { 0 2px 14px rgba(168, 230, 0, 0.45), 0 0 0 1px rgba(168, 230, 0, 0.30); } + +/* ── Material 3 ── */ +html[data-design='material3'] .mini-cal { + border-radius: var(--md-sys-shape-corner-medium); + background: var(--md-sys-color-surface-container-low); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} + +html[data-design='material3'] .mini-month { + font-size: var(--md-sys-typescale-title-large-size); + line-height: var(--md-sys-typescale-title-large-line); + font-weight: var(--md-sys-typescale-title-large-weight); + letter-spacing: var(--md-sys-typescale-title-large-tracking); + color: var(--md-sys-color-on-surface); + text-shadow: none; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +html[data-design='material3'] .mini-nav { + border-radius: var(--md-sys-shape-corner-full); + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .mini-nav:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-highest)); + border-color: var(--md-sys-color-outline); + box-shadow: none; + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .mini-nav:active { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, var(--md-sys-color-surface-container-highest)); + box-shadow: none; + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .dow-row { + border-bottom: 1px solid var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .dow { + font-size: var(--md-sys-typescale-label-medium-size); + line-height: var(--md-sys-typescale-label-medium-line); + font-weight: var(--md-sys-typescale-label-medium-weight); + letter-spacing: var(--md-sys-typescale-label-medium-tracking); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .day-inner { + font-size: var(--md-sys-typescale-body-medium-size); + line-height: var(--md-sys-typescale-body-medium-line); + font-weight: var(--md-sys-typescale-body-medium-weight); + color: var(--md-sys-color-on-surface-variant); + border-radius: var(--md-sys-shape-corner-full); +} + +html[data-design='material3'] .day-cell:hover:not(.in-range) .day-inner { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + box-shadow: none; + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .day-cell.other-month .day-inner { + color: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 45%, transparent); +} + +/* Today (не в диапазоне) — тонированный контур, как в M3 date picker */ +html[data-design='material3'] .day-cell.is-today:not(.in-range) .day-inner { + color: var(--md-sys-color-primary); + font-size: var(--md-sys-typescale-title-small-size); + line-height: var(--md-sys-typescale-title-small-line); + font-weight: var(--md-sys-typescale-title-small-weight); + background: transparent; + box-shadow: inset 0 0 0 1px var(--md-sys-color-primary); +} + +/* Диапазон недели — плоская тональная полоса (secondary-container) */ +html[data-design='material3'] .day-cell.in-range:not(.range-start):not(.range-end)::before, +html[data-design='material3'] .day-cell.range-start:not(.range-end)::before, +html[data-design='material3'] .day-cell.range-end:not(.range-start)::before { + background: var(--md-sys-color-secondary-container); + border-top: none; + border-bottom: none; +} + +html[data-design='material3'] .day-cell.in-range:not(.range-start):not(.range-end) .day-inner { + color: var(--md-sys-color-on-secondary-container); + font-weight: var(--md-sys-typescale-body-medium-weight); +} + +/* Начало/конец диапазона — заполненный primary-круг, эталонный M3-паттерн выбранного дня */ +html[data-design='material3'] .day-cell.range-start .day-inner, +html[data-design='material3'] .day-cell.range-end .day-inner { + background: var(--md-sys-color-primary); + color: var(--md-sys-color-on-primary); + font-weight: var(--md-sys-typescale-title-small-weight); + box-shadow: none; +} + +html[data-design='material3'] .day-cell.is-today.in-range:not(.range-start):not(.range-end) .day-inner { + color: var(--md-sys-color-on-secondary-container); + font-size: var(--md-sys-typescale-title-small-size); + line-height: var(--md-sys-typescale-title-small-line); + font-weight: var(--md-sys-typescale-title-small-weight); + background: var(--md-sys-color-secondary-container); + box-shadow: inset 0 0 0 1px var(--md-sys-color-primary); +} + +html[data-design='material3'] .day-cell.is-today.range-start .day-inner, +html[data-design='material3'] .day-cell.is-today.range-end .day-inner { + box-shadow: inset 0 0 0 2px var(--md-sys-color-outline); +} diff --git a/src/renderer/src/components/calendar/WeekView.vue b/src/renderer/src/components/calendar/WeekView.vue index 5616ee9..ca3cce6 100644 --- a/src/renderer/src/components/calendar/WeekView.vue +++ b/src/renderer/src/components/calendar/WeekView.vue @@ -312,11 +312,11 @@ function calendarColor(calendarId: string): string { /> + - -
-
-
+ +
+
@@ -327,6 +327,7 @@ function calendarColor(calendarId: string): string { flex-direction: column; height: 100%; overflow: hidden; + position: relative; } /* ── Day headers ── */ @@ -665,4 +666,145 @@ function calendarColor(calendarId: string): string { @keyframes spin { to { transform: rotate(360deg); } } + +/* ── Material 3 ── */ +html[data-design='material3'] .day-headers { + border-bottom: 1px solid var(--md-sys-color-outline-variant); + background: var(--md-sys-color-surface-container-low); +} + +html[data-design='material3'] .corner-badge { + background: var(--md-sys-color-secondary-container); + border: none; + color: var(--md-sys-color-on-secondary-container); + box-shadow: none; + border-radius: var(--md-sys-shape-corner-full); +} + +html[data-design='material3'] .day-header { + border-left: 1px solid var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .day-header.today { + background: color-mix(in srgb, var(--md-sys-color-primary) 6%, transparent); +} + +html[data-design='material3'] .day-name { + font-size: var(--md-sys-typescale-label-medium-size); + line-height: var(--md-sys-typescale-label-medium-line); + font-weight: var(--md-sys-typescale-label-medium-weight); + letter-spacing: var(--md-sys-typescale-label-medium-tracking); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .day-header.today .day-name { + color: var(--md-sys-color-primary); +} + +html[data-design='material3'] .day-num-wrap.today { + box-shadow: none; +} + +html[data-design='material3'] .day-num { + font-size: var(--md-sys-typescale-body-medium-size); + line-height: var(--md-sys-typescale-body-medium-line); + font-weight: var(--md-sys-typescale-body-medium-weight); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .day-num-wrap.today .day-num { + font-size: var(--md-sys-typescale-title-small-size); + line-height: var(--md-sys-typescale-title-small-line); + font-weight: var(--md-sys-typescale-title-small-weight); +} + +html[data-design='material3'] .summary-dot { + box-shadow: none; +} + +html[data-design='material3'] .summary-hrs { + font-size: var(--md-sys-typescale-label-small-size); + line-height: var(--md-sys-typescale-label-small-line); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .allday-row { + border-bottom: 1px solid var(--md-sys-color-outline-variant); + background: var(--md-sys-color-surface-container-lowest); +} + +html[data-design='material3'] .allday-label { + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .allday-col { + border-left: 1px solid var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .allday-event { + border-radius: var(--md-sys-shape-corner-small); + background: color-mix(in srgb, var(--event-color) 22%, var(--md-sys-color-surface-container-high)); + border: 1px solid color-mix(in srgb, var(--event-color) 40%, var(--md-sys-color-outline-variant)); + color: var(--md-sys-color-on-surface); + font-size: var(--md-sys-typescale-label-medium-size); + line-height: var(--md-sys-typescale-label-medium-line); +} + +html[data-design='material3'] .allday-event:hover { + filter: none; + background: color-mix(in srgb, var(--event-color) 30%, var(--md-sys-color-surface-container-high)); +} + +html[data-design='material3'] .grid-scroll { + scrollbar-color: var(--md-sys-color-outline-variant) transparent; +} + +html[data-design='material3'] .grid-scroll::-webkit-scrollbar-thumb { + background: var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .hour-label { + font-size: var(--md-sys-typescale-label-small-size); + line-height: var(--md-sys-typescale-label-small-line); + color: var(--md-sys-color-on-surface-variant); + opacity: 1; +} + +html[data-design='material3'] .day-col { + border-left: 1px solid var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .day-col.today { + background: color-mix(in srgb, var(--md-sys-color-primary) 4%, transparent); +} + +html[data-design='material3'] .hour-row { + border-top: 1px solid var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .half-hour-row { + border-top: 1px dashed color-mix(in srgb, var(--md-sys-color-outline-variant) 55%, transparent); +} + +/* «Сейчас» — красная линия, как в эталонных M3-календарях (error-роль) */ +html[data-design='material3'] .now-line { + background: var(--md-sys-color-error); + box-shadow: none; +} + +html[data-design='material3'] .now-dot { + background: var(--md-sys-color-error); + box-shadow: none; + animation: none; +} + +html[data-design='material3'] .loading-overlay { + background: color-mix(in srgb, var(--md-sys-color-scrim) 55%, transparent); +} + +html[data-design='material3'] .loading-ring { + border: 2px solid var(--md-sys-color-outline-variant); + border-top-color: var(--md-sys-color-primary); + box-shadow: none; +} diff --git a/src/renderer/src/components/layout/AppShell.vue b/src/renderer/src/components/layout/AppShell.vue index 18ffb73..99732ca 100644 --- a/src/renderer/src/components/layout/AppShell.vue +++ b/src/renderer/src/components/layout/AppShell.vue @@ -334,4 +334,93 @@ onUnmounted(() => document.removeEventListener('keydown', onGlobalKeydown)) transform: translateY(0); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.18); } + +/* ── Material 3 ── */ +html[data-design='material3'] .app-shell { + background: var(--md-sys-color-surface); +} + +html[data-design='material3'] .account-bar { + border-radius: var(--md-sys-shape-corner-large); + border: 1px solid var(--md-sys-color-outline-variant); + background: var(--md-sys-color-surface-container-low); + box-shadow: none; +} + +html[data-design='material3'] .folder-pane { + border-radius: var(--md-sys-shape-corner-large); + border: 1px solid var(--md-sys-color-outline-variant); + background: var(--md-sys-color-surface-container-low); + box-shadow: none; +} + +html[data-design='material3'] .message-pane { + border-radius: var(--md-sys-shape-corner-large); + border: 1px solid var(--md-sys-color-outline-variant); + background: var(--md-sys-color-surface-container); + box-shadow: none; +} + +html[data-design='material3'] .preview-pane { + border-radius: var(--md-sys-shape-corner-large); + border: 1px solid var(--md-sys-color-outline-variant); + background: var(--md-sys-color-surface); + box-shadow: none; +} + +html[data-design='material3'] .resize-handle:hover::after, +html[data-design='material3'] .resize-handle:active::after { + background: var(--md-sys-color-primary); +} + +html[data-design='material3'] .empty-content { + background: var(--md-sys-color-surface-container-high); + border: 1px solid var(--md-sys-color-outline-variant); + border-radius: var(--md-sys-shape-corner-extra-large); + box-shadow: var(--md-sys-elevation-2); +} + +html[data-design='material3'] .empty-content::before { + display: none; +} + +html[data-design='material3'] .empty-icon { + opacity: 0.7; + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .empty-content h2 { + font-size: var(--md-sys-typescale-headline-small-size); + line-height: var(--md-sys-typescale-headline-small-line); + font-weight: var(--md-sys-typescale-headline-small-weight); + letter-spacing: var(--md-sys-typescale-headline-small-tracking); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .empty-content p { + font-size: var(--md-sys-typescale-body-medium-size); + line-height: var(--md-sys-typescale-body-medium-line); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .add-btn { + background: var(--md-sys-color-primary); + color: var(--md-sys-color-on-primary); + border-radius: var(--md-sys-shape-corner-full); + font-size: var(--md-sys-typescale-label-large-size); + font-weight: var(--md-sys-typescale-label-large-weight); + box-shadow: none; +} + +html[data-design='material3'] .add-btn:hover { + background: color-mix(in srgb, var(--md-sys-color-on-primary) 8%, var(--md-sys-color-primary)); + box-shadow: none; + transform: none; +} + +html[data-design='material3'] .add-btn:active { + background: color-mix(in srgb, var(--md-sys-color-on-primary) 10%, var(--md-sys-color-primary)); + box-shadow: none; + transform: none; +} diff --git a/src/renderer/src/components/layout/StatusBar.vue b/src/renderer/src/components/layout/StatusBar.vue index f456e0a..473adc1 100644 --- a/src/renderer/src/components/layout/StatusBar.vue +++ b/src/renderer/src/components/layout/StatusBar.vue @@ -72,4 +72,14 @@ const isConnected = computed(() => { .status-dot.connected { background: var(--success); } + +/* ── Material 3 ── */ +html[data-design='material3'] .statusbar { + background: var(--md-sys-color-surface-container-low); + border-top: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; + font-size: var(--md-sys-typescale-label-small-size); + line-height: var(--md-sys-typescale-label-small-line); + color: var(--md-sys-color-on-surface-variant); +} diff --git a/src/renderer/src/components/layout/TitleBar.vue b/src/renderer/src/components/layout/TitleBar.vue index b33fab6..a0bfc8a 100644 --- a/src/renderer/src/components/layout/TitleBar.vue +++ b/src/renderer/src/components/layout/TitleBar.vue @@ -78,4 +78,27 @@ function close(): void { background: var(--danger); color: white; } + +/* ── Material 3 ── */ +html[data-design='material3'] .titlebar { + background: var(--md-sys-color-surface-container-low); + border-bottom: 1px solid var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .app-title { + font-size: var(--md-sys-typescale-label-medium-size); + font-weight: var(--md-sys-typescale-label-medium-weight); + letter-spacing: var(--md-sys-typescale-label-medium-tracking); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .control-btn:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .control-btn.close:hover { + background: var(--md-sys-color-error); + color: var(--md-sys-color-on-error); +} diff --git a/src/renderer/src/components/messages/MessageList.vue b/src/renderer/src/components/messages/MessageList.vue index 03c1b2e..34be746 100644 --- a/src/renderer/src/components/messages/MessageList.vue +++ b/src/renderer/src/components/messages/MessageList.vue @@ -1340,4 +1340,228 @@ async function handleSwipeAction(action: SwipeAction, messageId: string): Promis line-height: 16px; backdrop-filter: blur(4px); } + +/* ══════════════════════════ Material 3 ══════════════════════════ */ + +html[data-design='material3'] .message-list-header { + background: var(--md-sys-color-surface-container-low); + border-bottom: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} + +html[data-design='material3'] .folder-title { + font-size: var(--md-sys-typescale-title-large-size); + line-height: var(--md-sys-typescale-title-large-line); + font-weight: 500; +} + +/* Счётчик непрочитанных — accent (primary), не error: error зарезервирован под danger */ +html[data-design='material3'] .message-count { + font-size: var(--md-sys-typescale-label-small-size); + color: var(--md-sys-color-on-primary-container); + background: var(--md-sys-color-primary-container); + border: 1px solid transparent; + box-shadow: none; +} +html[data-design='material3'] .message-count:hover { + background: color-mix(in srgb, var(--md-sys-color-on-primary-container) 8%, var(--md-sys-color-primary-container)); + border-color: transparent; + box-shadow: none; +} +html[data-design='material3'] .message-count.unread-active { + background: var(--md-sys-color-primary); + color: var(--md-sys-color-on-primary); + border-color: transparent; + box-shadow: none; +} + +html[data-design='material3'] .icon-btn { + background: transparent; + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} +html[data-design='material3'] .icon-btn:hover:not(:disabled) { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + border-color: var(--md-sys-color-outline); + box-shadow: none; +} +html[data-design='material3'] .icon-btn:active:not(:disabled) { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent); + box-shadow: none; +} +html[data-design='material3'] .icon-btn.active { + color: var(--md-sys-color-on-primary-container); + background: var(--md-sys-color-primary-container); + border-color: transparent; + box-shadow: none; +} + +html[data-design='material3'] .bulk-actions { + background: var(--md-sys-color-surface-container); + border-bottom: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} +html[data-design='material3'] .bulk-count { + font-size: var(--md-sys-typescale-body-small-size); +} +html[data-design='material3'] .bulk-count-num { + font-size: var(--md-sys-typescale-label-small-size); + color: var(--md-sys-color-on-primary-container); + background: var(--md-sys-color-primary-container); + border: 1px solid transparent; +} +html[data-design='material3'] .bulk-btn { + background: var(--md-sys-color-surface-container-high); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} +html[data-design='material3'] .bulk-btn:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-high)); + border-color: var(--md-sys-color-outline); + box-shadow: none; +} +html[data-design='material3'] .bulk-btn:active { + box-shadow: none; +} +html[data-design='material3'] .bulk-btn.danger { + color: var(--md-sys-color-error); + background: var(--md-sys-color-error-container); + border-color: transparent; + box-shadow: none; +} +html[data-design='material3'] .bulk-btn.danger:hover { + background: color-mix(in srgb, var(--md-sys-color-on-error-container) 10%, var(--md-sys-color-error-container)); + border-color: transparent; + color: var(--md-sys-color-on-error-container); + box-shadow: none; +} +html[data-design='material3'] .bulk-cancel:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); +} + +html[data-design='material3'] .select-all-row { + border-bottom: 1px solid var(--md-sys-color-outline-variant); + background: transparent; +} +html[data-design='material3'] .select-all-row:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); +} +html[data-design='material3'] .select-all-circle { + border-color: var(--md-sys-color-outline); +} +html[data-design='material3'] .select-all-circle.checked, +html[data-design='material3'] .select-all-circle.indeterminate { + background: var(--md-sys-color-primary); + border-color: var(--md-sys-color-primary); +} +html[data-design='material3'] .select-all-text { + font-size: var(--md-sys-typescale-body-small-size); +} + +html[data-design='material3'] .pull-indicator { + background: var(--md-sys-color-surface-container-high); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} +html[data-design='material3'] .pull-indicator.ready, +html[data-design='material3'] .pull-indicator.refreshing { + border-color: var(--md-sys-color-primary); + box-shadow: none; +} + +/* Открытый тред — плоская tonal-поверхность вместо радужного glass-градиента */ +html[data-design='material3'] .thread-group--open { + border-radius: var(--md-sys-shape-corner-medium); + background: var(--md-sys-color-surface-container-high); + border: 1px solid var(--md-sys-color-outline); + box-shadow: none; +} +html[data-design='material3'] .thread-group--open::before { + display: none; +} +html[data-design='material3'] .thread-group--open :deep(.thread-card), +html[data-design='material3'] .thread-group--open :deep(.thread-card.expanded) { + border-bottom: 1px solid var(--md-sys-color-outline-variant); +} +html[data-design='material3'] .thread-empty-filter { + border-top: 1px solid var(--md-sys-color-outline-variant); +} +html[data-design='material3'] .thread-children :deep(.thread-child-item:not(:first-child) .message-item) { + border-top: 1px solid var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .search-pill { + background: var(--md-sys-color-surface-container-high); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} +html[data-design='material3'] .search-pill:hover:not(.search-pill--open) { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-high)); + border-color: var(--md-sys-color-outline); + box-shadow: none; +} +html[data-design='material3'] .search-pill--open { + background: var(--md-sys-color-surface-container-highest); + border-color: var(--md-sys-color-primary); + box-shadow: none; +} +html[data-design='material3'] .search-pill-icon { + color: var(--md-sys-color-on-surface-variant); +} +html[data-design='material3'] .search-pill--open .search-pill-icon { + color: var(--md-sys-color-primary); +} +html[data-design='material3'] .search-pill-input { + font-size: var(--md-sys-typescale-body-medium-size); +} +html[data-design='material3'] .search-pill-input::placeholder { + color: var(--md-sys-color-on-surface-variant); +} +html[data-design='material3'] .search-pill-close { + color: var(--md-sys-color-on-surface-variant); +} +html[data-design='material3'] .search-pill-close:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .search-results-count { + font-size: var(--md-sys-typescale-body-small-size); +} +html[data-design='material3'] .search-result-item { + border-radius: var(--md-sys-shape-corner-medium); + background: var(--md-sys-color-surface-container-low); + border: 1px solid transparent; +} +html[data-design='material3'] .search-result-item:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-low)); + border-color: transparent; + box-shadow: none; +} +html[data-design='material3'] .search-result-item.selected { + background: var(--md-sys-color-secondary-container); + border-color: transparent; + box-shadow: none; +} +html[data-design='material3'] .search-result-item.selected .search-result-from, +html[data-design='material3'] .search-result-item.selected .search-result-subject, +html[data-design='material3'] .search-result-item.selected .search-result-date { + color: var(--md-sys-color-on-secondary-container); +} +html[data-design='material3'] .search-result-from { + font-size: var(--md-sys-typescale-title-medium-size); + font-weight: var(--md-sys-typescale-title-medium-weight); +} +html[data-design='material3'] .search-result-date { + font-size: var(--md-sys-typescale-label-medium-size); +} +html[data-design='material3'] .search-result-subject { + font-size: var(--md-sys-typescale-body-medium-size); +} +html[data-design='material3'] .search-result-folder { + font-size: var(--md-sys-typescale-label-small-size); + color: var(--md-sys-color-primary); + background: var(--md-sys-color-primary-container); + border: 1px solid transparent; +} diff --git a/src/renderer/src/components/messages/MessageListItem.vue b/src/renderer/src/components/messages/MessageListItem.vue index fbe89ee..d36e303 100644 --- a/src/renderer/src/components/messages/MessageListItem.vue +++ b/src/renderer/src/components/messages/MessageListItem.vue @@ -494,4 +494,92 @@ onUnmounted(() => { } .flag-icon { color: var(--warning); } .attachment-icon { color: var(--text-muted); } + +/* ── Material 3 ── */ +html[data-design='material3'] .swipe-wrapper { + border-radius: var(--md-sys-shape-corner-medium); + background: var(--md-sys-color-surface-container-low); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} + +html[data-design='material3'] .swipe-wrapper:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-low)); + border-color: var(--md-sys-color-outline); + box-shadow: none; +} + +html[data-design='material3'] .swipe-wrapper:has(.message-item.selected) { + border-color: var(--md-sys-color-outline); + box-shadow: none; +} + +html[data-design='material3'] .message-item { + background: none; +} + +html[data-design='material3'] .message-item.unread { + background: none; +} + +html[data-design='material3'] .message-item:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); +} + +html[data-design='material3'] .message-item.selected { + background: var(--md-sys-color-secondary-container); +} + +html[data-design='material3'] .message-item.selected::after { + box-shadow: none; +} + +html[data-design='material3'] .message-item.selected:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-secondary-container)); +} + +html[data-design='material3'] .message-item.selected .sender, +html[data-design='material3'] .message-item.selected .subject, +html[data-design='material3'] .message-item.selected .snippet, +html[data-design='material3'] .message-item.selected .date { + color: var(--md-sys-color-on-secondary-container); +} + +html[data-design='material3'] .message-item.checked { + background: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent); +} + +html[data-design='material3'] .message-item.checked:hover { + background: color-mix(in srgb, var(--md-sys-color-primary) 18%, transparent); +} + +html[data-design='material3'] .unread-dot { + box-shadow: none; +} + +html[data-design='material3'] .sender { + font-size: var(--md-sys-typescale-body-medium-size); + line-height: var(--md-sys-typescale-body-medium-line); +} + +html[data-design='material3'] .sender.font-bold { + font-size: var(--md-sys-typescale-title-medium-size); + line-height: var(--md-sys-typescale-title-medium-line); + font-weight: var(--md-sys-typescale-title-medium-weight); +} + +html[data-design='material3'] .subject { + font-size: var(--md-sys-typescale-body-medium-size); + line-height: var(--md-sys-typescale-body-medium-line); +} + +html[data-design='material3'] .date { + font-size: var(--md-sys-typescale-label-medium-size); + line-height: var(--md-sys-typescale-label-medium-line); +} + +html[data-design='material3'] .snippet { + font-size: var(--md-sys-typescale-body-small-size); + line-height: var(--md-sys-typescale-body-small-line); +} diff --git a/src/renderer/src/components/messages/ThreadContextMenu.vue b/src/renderer/src/components/messages/ThreadContextMenu.vue index 90e926c..fbac320 100644 --- a/src/renderer/src/components/messages/ThreadContextMenu.vue +++ b/src/renderer/src/components/messages/ThreadContextMenu.vue @@ -115,4 +115,28 @@ onUnmounted(() => { .menu-item:active { background: rgba(255, 255, 255, 0.05); } + +/* ── Material 3 ── */ +html[data-design='material3'] .context-menu { + background: var(--md-sys-color-surface-container); + border: 1px solid var(--md-sys-color-outline-variant); + border-radius: var(--md-sys-shape-corner-small); + box-shadow: var(--md-sys-elevation-2); + animation: menu-in var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized-decelerate); +} + +html[data-design='material3'] .menu-item { + border-radius: var(--md-sys-shape-corner-extra-small); + font-size: var(--md-sys-typescale-body-medium-size); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .menu-item:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .menu-item:active { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent); +} diff --git a/src/renderer/src/components/messages/ThreadListItem.vue b/src/renderer/src/components/messages/ThreadListItem.vue index 6935c47..c33c6cb 100644 --- a/src/renderer/src/components/messages/ThreadListItem.vue +++ b/src/renderer/src/components/messages/ThreadListItem.vue @@ -403,4 +403,127 @@ const snippet = computed(() => props.thread.latest.snippet || '') .thread-card.expanded .thread-item { background: transparent; } + +/* ── Material 3 ── */ +html[data-design='material3'] .thread-card { + border-radius: var(--md-sys-shape-corner-medium); + background: var(--md-sys-color-surface-container-low); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} + +html[data-design='material3'] .thread-card:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-low)); + border-color: var(--md-sys-color-outline); + box-shadow: none; +} + +html[data-design='material3'] .thread-card.unread { + background: var(--md-sys-color-surface-container-low); +} + +html[data-design='material3'] .thread-card.selected { + border-color: var(--md-sys-color-outline); + box-shadow: none; +} + +html[data-design='material3'] .thread-item.selected { + background: var(--md-sys-color-secondary-container); +} + +html[data-design='material3'] .thread-item.selected .thread-participants, +html[data-design='material3'] .thread-item.selected .thread-subject, +html[data-design='material3'] .thread-item.selected .thread-date, +html[data-design='material3'] .thread-item.selected .thread-snippet { + color: var(--md-sys-color-on-secondary-container); +} + +html[data-design='material3'] .thread-item:not(.selected):hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); +} + +html[data-design='material3'] .thread-check-circle { + border-color: var(--md-sys-color-outline); +} + +html[data-design='material3'] .thread-check-circle.checked, +html[data-design='material3'] .thread-check-circle.indeterminate { + background: var(--md-sys-color-primary); + border-color: var(--md-sys-color-primary); +} + +html[data-design='material3'] .unread-dot { + box-shadow: none; +} + +html[data-design='material3'] .thread-participants { + font-size: var(--md-sys-typescale-body-medium-size); + line-height: var(--md-sys-typescale-body-medium-line); +} + +html[data-design='material3'] .thread-participants.bold { + font-size: var(--md-sys-typescale-title-medium-size); + line-height: var(--md-sys-typescale-title-medium-line); + font-weight: var(--md-sys-typescale-title-medium-weight); +} + +html[data-design='material3'] .thread-date { + font-size: var(--md-sys-typescale-label-medium-size); + line-height: var(--md-sys-typescale-label-medium-line); +} + +html[data-design='material3'] .thread-subject { + font-size: var(--md-sys-typescale-body-medium-size); + line-height: var(--md-sys-typescale-body-medium-line); +} + +html[data-design='material3'] .thread-subject.bold { + font-weight: 500; + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .thread-snippet { + font-size: var(--md-sys-typescale-body-small-size); + line-height: var(--md-sys-typescale-body-small-line); +} + +html[data-design='material3'] .thread-count { + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; + font-size: var(--md-sys-typescale-label-small-size); +} + +html[data-design='material3'] .thread-item.unread .thread-count { + color: var(--md-sys-color-primary); + background: var(--md-sys-color-primary-container); + border-color: transparent; +} + +html[data-design='material3'] .thread-filter-btn { + border-radius: var(--md-sys-shape-corner-extra-small); + background: transparent; + border: 1px solid var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .thread-filter-btn:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + border-color: var(--md-sys-color-outline); +} + +html[data-design='material3'] .thread-filter-btn.active { + color: var(--md-sys-color-primary); + background: var(--md-sys-color-primary-container); + border-color: transparent; +} + +html[data-design='material3'] .thread-chevron.open { + color: var(--md-sys-color-primary); +} + +html[data-design='material3'] .thread-card.expanded { + border-color: var(--md-sys-color-outline); + background: var(--md-sys-color-surface-container); + box-shadow: none; +} diff --git a/src/renderer/src/components/notifications/NotificationToast.vue b/src/renderer/src/components/notifications/NotificationToast.vue index 1f957ca..d38cea3 100644 --- a/src/renderer/src/components/notifications/NotificationToast.vue +++ b/src/renderer/src/components/notifications/NotificationToast.vue @@ -149,4 +149,46 @@ onMounted(() => { background: rgba(255, 255, 255, 0.12); color: var(--text-secondary); } + +/* ── Material 3 (Snackbar-like surface) ── */ +html[data-design='material3'] .toast { + background: var(--md-sys-color-inverse-surface); + border: none; + border-radius: var(--md-sys-shape-corner-extra-small); + box-shadow: var(--md-sys-elevation-3); +} + +html[data-design='material3'] .toast:hover { + background: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 6%, var(--md-sys-color-inverse-surface)); + border: none; +} + +html[data-design='material3'] .toast-icon { + color: var(--md-sys-color-inverse-primary); + background: color-mix(in srgb, var(--md-sys-color-inverse-primary) 16%, transparent); + border: none; +} + +html[data-design='material3'] .toast-from { + color: var(--md-sys-color-inverse-on-surface); + font-size: var(--md-sys-typescale-title-small-size); + font-weight: var(--md-sys-typescale-title-small-weight); +} + +html[data-design='material3'] .toast-subject, +html[data-design='material3'] .toast-account { + color: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 75%, transparent); + font-size: var(--md-sys-typescale-body-small-size); +} + +html[data-design='material3'] .toast-close { + background: transparent; + border: none; + color: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 75%, transparent); +} + +html[data-design='material3'] .toast-close:hover { + background: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 12%, transparent); + color: var(--md-sys-color-inverse-on-surface); +} diff --git a/src/renderer/src/components/preview/AttachmentStrip.vue b/src/renderer/src/components/preview/AttachmentStrip.vue index 6c94e45..b506c30 100644 --- a/src/renderer/src/components/preview/AttachmentStrip.vue +++ b/src/renderer/src/components/preview/AttachmentStrip.vue @@ -323,4 +323,67 @@ async function handleClick(att: Attachment): Promise { /* Спиннер */ @keyframes spin { to { transform: rotate(360deg); } } .spinner-svg { animation: spin 0.8s linear infinite; } + +/* ── Material 3 ── */ +html[data-design='material3'] .attachment-strip { + border-radius: var(--md-sys-shape-corner-medium); + border: 1px solid var(--md-sys-color-outline-variant); + background: var(--md-sys-color-surface-container-low); + box-shadow: none; +} + +html[data-design='material3'] .strip-label { + font-size: var(--md-sys-typescale-label-small-size); +} + +html[data-design='material3'] .att-chip { + border-radius: var(--md-sys-shape-corner-small); + background: var(--md-sys-color-surface-container-high); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} + +html[data-design='material3'] .att-chip:hover:not(.is-busy) { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-high)); + border-color: var(--md-sys-color-outline); + box-shadow: none; +} + +html[data-design='material3'] .att-chip:active:not(.is-busy) { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, var(--md-sys-color-surface-container-high)); +} + +html[data-design='material3'] .att-chip.is-done { + border-color: transparent; + background: color-mix(in srgb, var(--success) 20%, transparent); + box-shadow: none; +} + +html[data-design='material3'] .att-chip.is-saved { + border-color: transparent; + background: color-mix(in srgb, var(--success) 12%, transparent); +} + +html[data-design='material3'] .att-chip.is-saved:hover { + border-color: transparent; + background: color-mix(in srgb, var(--success) 18%, transparent); + box-shadow: none; +} + +html[data-design='material3'] .att-chip.is-error { + border-color: transparent; + background: var(--md-sys-color-error-container); +} + +html[data-design='material3'] .att-chip.is-error .att-icon { + color: var(--md-sys-color-on-error-container); +} + +html[data-design='material3'] .att-name { + font-size: var(--md-sys-typescale-body-small-size); +} + +html[data-design='material3'] .att-size { + font-size: var(--md-sys-typescale-label-small-size); +} diff --git a/src/renderer/src/components/preview/MessageBody.vue b/src/renderer/src/components/preview/MessageBody.vue index fa62064..a9499ab 100644 --- a/src/renderer/src/components/preview/MessageBody.vue +++ b/src/renderer/src/components/preview/MessageBody.vue @@ -295,4 +295,12 @@ onUnmounted(() => { color: var(--text-muted); font-size: 13px; } + +/* ── Material 3 (только обёртка — содержимое письма не трогаем) ── */ +html[data-design='material3'] .message-body { + border-radius: var(--md-sys-shape-corner-large); + border: 1px solid var(--md-sys-color-outline-variant); + background: var(--md-sys-color-surface-container-low); + box-shadow: none; +} diff --git a/src/renderer/src/components/preview/MessageHeader.vue b/src/renderer/src/components/preview/MessageHeader.vue index 73f1bd3..a18dce3 100644 --- a/src/renderer/src/components/preview/MessageHeader.vue +++ b/src/renderer/src/components/preview/MessageHeader.vue @@ -626,4 +626,152 @@ onUnmounted(() => { inset 0 1px 0 rgba(255, 100, 100, 0.12), 0 4px 12px rgba(180, 30, 30, 0.22); } + +/* ── Material 3 ── */ +html[data-design='material3'] .message-header { + border-radius: var(--md-sys-shape-corner-extra-large); + border: 1px solid var(--md-sys-color-outline-variant); + background: var(--md-sys-color-surface-container-low); + box-shadow: none; +} + +html[data-design='material3'] .subject { + font-size: var(--md-sys-typescale-title-large-size); + line-height: var(--md-sys-typescale-title-large-line); + font-weight: 500; + letter-spacing: normal; +} + +html[data-design='material3'] .header-details { + background: var(--md-sys-color-surface-container); + border: 1px solid var(--md-sys-color-outline-variant); + border-radius: var(--md-sys-shape-corner-medium); + box-shadow: none; +} + +html[data-design='material3'] .header-row { + border-bottom: 1px solid var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .label { + font-size: var(--md-sys-typescale-label-small-size); +} + +html[data-design='material3'] .value { + font-size: var(--md-sys-typescale-body-medium-size); +} + +html[data-design='material3'] .addr-chip { + font-size: var(--md-sys-typescale-body-medium-size); +} + +html[data-design='material3'] .addr-chip:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + border-color: transparent; + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .addr-chip--more { + background: var(--md-sys-color-surface-container-high); + border-color: transparent; +} + +html[data-design='material3'] .addr-chip--more:hover { + color: var(--md-sys-color-primary); + background: var(--md-sys-color-primary-container); + border-color: transparent; +} + +html[data-design='material3'] .contact-popup { + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline-variant); + border-radius: var(--md-sys-shape-corner-medium); + box-shadow: var(--md-sys-elevation-2); +} + +html[data-design='material3'] .popup-name { + font-size: var(--md-sys-typescale-title-small-size); + font-weight: var(--md-sys-typescale-title-small-weight); +} + +html[data-design='material3'] .popup-email { + font-size: var(--md-sys-typescale-body-small-size); +} + +html[data-design='material3'] .popup-copy { + border-radius: var(--md-sys-shape-corner-full); + background: transparent; + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} + +html[data-design='material3'] .popup-copy:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + border-color: var(--md-sys-color-outline); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .popup-copy.done { + color: var(--md-sys-color-primary); + background: var(--md-sys-color-primary-container); + border-color: transparent; +} + +html[data-design='material3'] .action-btn { + font-size: var(--md-sys-typescale-label-large-size); + font-weight: var(--md-sys-typescale-label-large-weight); + background: transparent; + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} + +html[data-design='material3'] .action-btn:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + border-color: var(--md-sys-color-outline); + box-shadow: none; +} + +html[data-design='material3'] .action-btn:active { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent); + box-shadow: none; +} + +html[data-design='material3'] .action-btn.active { + background: var(--md-sys-color-secondary-container); + border-color: transparent; + color: var(--md-sys-color-on-secondary-container); +} + +html[data-design='material3'] .action-btn.flag-active { + color: var(--warning); + background: color-mix(in srgb, var(--warning) 18%, transparent); + border-color: transparent; + box-shadow: none; +} + +html[data-design='material3'] .action-btn.flag-active:hover { + background: color-mix(in srgb, var(--warning) 26%, transparent); + border-color: transparent; +} + +html[data-design='material3'] .action-btn.primary { + background: var(--md-sys-color-primary); + color: var(--md-sys-color-on-primary); + border-color: transparent; + box-shadow: none; +} + +html[data-design='material3'] .action-btn.primary:hover { + background: color-mix(in srgb, var(--md-sys-color-on-primary) 8%, var(--md-sys-color-primary)); + color: var(--md-sys-color-on-primary); + border-color: transparent; + box-shadow: none; +} + +html[data-design='material3'] .action-btn.danger:hover { + color: var(--md-sys-color-on-error-container); + background: var(--md-sys-color-error-container); + border-color: transparent; + box-shadow: none; +} diff --git a/src/renderer/src/components/preview/MessagePreview.vue b/src/renderer/src/components/preview/MessagePreview.vue index 18fc0ca..006905c 100644 --- a/src/renderer/src/components/preview/MessagePreview.vue +++ b/src/renderer/src/components/preview/MessagePreview.vue @@ -95,4 +95,16 @@ const selectedMessage = computed(() => @keyframes spin { to { transform: rotate(360deg); } } + +/* ── Material 3 ── */ +html[data-design='material3'] .loading-body { + border-radius: var(--md-sys-shape-corner-medium); + border: 1px solid var(--md-sys-color-outline-variant); + background: var(--md-sys-color-surface-container-low); +} + +html[data-design='material3'] .spinner { + border: 1.5px solid var(--md-sys-color-outline-variant); + border-top-color: var(--md-sys-color-primary); +} diff --git a/src/renderer/src/components/sidebar/AccountSwitcher.vue b/src/renderer/src/components/sidebar/AccountSwitcher.vue index bb89327..203cec5 100644 --- a/src/renderer/src/components/sidebar/AccountSwitcher.vue +++ b/src/renderer/src/components/sidebar/AccountSwitcher.vue @@ -177,4 +177,60 @@ function getAccountColor(index: number): string { .nav-btn.nav-active .nav-icon { color: var(--accent); } + +/* ── Material 3 (Navigation Rail) ── */ +html[data-design='material3'] .account-btn:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); +} + +html[data-design='material3'] .account-avatar { + box-shadow: none; +} + +html[data-design='material3'] .account-btn.active .account-avatar { + box-shadow: + 0 0 0 2px var(--md-sys-color-surface-container-low), + 0 0 0 3.5px var(--md-sys-color-primary); +} + +html[data-design='material3'] .add-btn, +html[data-design='material3'] .settings-btn { + background: var(--md-sys-color-surface-container-high); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} + +html[data-design='material3'] .add-btn:hover, +html[data-design='material3'] .settings-btn:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-high)); + border-color: var(--md-sys-color-outline); + box-shadow: none; +} + +html[data-design='material3'] .add-btn:active, +html[data-design='material3'] .settings-btn:active { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, var(--md-sys-color-surface-container-high)); + box-shadow: none; +} + +html[data-design='material3'] .add-icon, +html[data-design='material3'] .settings-icon, +html[data-design='material3'] .nav-icon { + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .add-btn:hover .add-icon, +html[data-design='material3'] .settings-btn:hover .settings-icon, +html[data-design='material3'] .nav-btn:hover .nav-icon { + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .nav-btn.nav-active { + background: var(--md-sys-color-secondary-container); + border-color: transparent; +} + +html[data-design='material3'] .nav-btn.nav-active .nav-icon { + color: var(--md-sys-color-on-secondary-container); +} diff --git a/src/renderer/src/components/sidebar/FolderContextMenu.vue b/src/renderer/src/components/sidebar/FolderContextMenu.vue index 49d89c8..f9ae3b3 100644 --- a/src/renderer/src/components/sidebar/FolderContextMenu.vue +++ b/src/renderer/src/components/sidebar/FolderContextMenu.vue @@ -197,4 +197,33 @@ onUnmounted(() => { margin-left: 4px; animation: menu-in 120ms cubic-bezier(0.34, 1.15, 0.64, 1); } + +/* ── Material 3 ── */ +html[data-design='material3'] .context-menu, +html[data-design='material3'] .submenu { + background: var(--md-sys-color-surface-container); + border: 1px solid var(--md-sys-color-outline-variant); + border-radius: var(--md-sys-shape-corner-small); + box-shadow: var(--md-sys-elevation-2); + animation: menu-in var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized-decelerate); +} + +html[data-design='material3'] .menu-item { + border-radius: var(--md-sys-shape-corner-extra-small); + font-size: var(--md-sys-typescale-body-medium-size); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .menu-item:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .menu-item:active { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent); +} + +html[data-design='material3'] .menu-divider { + background: var(--md-sys-color-outline-variant); +} diff --git a/src/renderer/src/components/sidebar/FolderTree.vue b/src/renderer/src/components/sidebar/FolderTree.vue index 95c0553..a3b3f7c 100644 --- a/src/renderer/src/components/sidebar/FolderTree.vue +++ b/src/renderer/src/components/sidebar/FolderTree.vue @@ -75,4 +75,21 @@ const accountsStore = useAccountsStore() font-size: 12px; text-align: center; } + +/* ── Material 3 ── */ +html[data-design='material3'] .folder-header { + border-bottom: 1px solid var(--md-sys-color-outline-variant); + background: none; + box-shadow: none; + font-size: var(--md-sys-typescale-label-medium-size); + font-weight: var(--md-sys-typescale-label-medium-weight); + letter-spacing: var(--md-sys-typescale-label-medium-tracking); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .loading, +html[data-design='material3'] .empty { + font-size: var(--md-sys-typescale-body-medium-size); + color: var(--md-sys-color-on-surface-variant); +} diff --git a/src/renderer/src/components/sidebar/FolderTreeItem.vue b/src/renderer/src/components/sidebar/FolderTreeItem.vue index 07c6eaf..51a9211 100644 --- a/src/renderer/src/components/sidebar/FolderTreeItem.vue +++ b/src/renderer/src/components/sidebar/FolderTreeItem.vue @@ -289,4 +289,94 @@ function handleMarkAllRead(): void { color: var(--text-muted); opacity: 0.65; } + +/* ── Material 3 (Navigation Drawer list item) ── */ +html[data-design='material3'] .folder-item { + border-radius: var(--md-sys-shape-corner-full); +} + +html[data-design='material3'] .folder-item:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + border-color: transparent; + box-shadow: none; +} + +html[data-design='material3'] .folder-item.active { + background: var(--md-sys-color-secondary-container); + backdrop-filter: none; + border-color: transparent; + box-shadow: none; +} + +html[data-design='material3'] .folder-item.active:hover { + background: color-mix(in srgb, var(--md-sys-color-on-secondary-container) 8%, var(--md-sys-color-secondary-container)); +} + +html[data-design='material3'] .folder-icon { + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .folder-item:hover .folder-icon { + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .folder-item.active .folder-icon { + color: var(--md-sys-color-on-secondary-container); +} + +html[data-design='material3'] .folder-name { + font-size: var(--md-sys-typescale-label-large-size); + line-height: var(--md-sys-typescale-label-large-line); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .folder-item:hover .folder-name { + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .folder-item.active .folder-name { + color: var(--md-sys-color-on-secondary-container); + font-weight: var(--md-sys-typescale-label-large-weight); +} + +html[data-design='material3'] .unread-badge { + color: var(--md-sys-color-on-error); + background: var(--md-sys-color-error); + border: none; + box-shadow: none; + backdrop-filter: none; + font-size: var(--md-sys-typescale-label-small-size); + line-height: var(--md-sys-typescale-label-small-line); + font-weight: var(--md-sys-typescale-label-small-weight); +} + +html[data-design='material3'] .folder-item:hover .unread-badge { + background: var(--md-sys-color-error); +} + +html[data-design='material3'] .folder-item.active .unread-badge { + background: var(--md-sys-color-error); + border: none; +} + +html[data-design='material3'] .unread-badge.muted { + background: var(--md-sys-color-surface-container-highest); + border: none; + box-shadow: none; + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .folder-item:hover .unread-badge.muted { + background: var(--md-sys-color-surface-container-highest); +} + +html[data-design='material3'] .folder-item.active .unread-badge.muted { + background: var(--md-sys-color-surface-container-highest); + border: none; +} + +html[data-design='material3'] .muted-icon { + color: var(--md-sys-color-on-surface-variant); + opacity: 0.8; +} diff --git a/src/renderer/src/main.ts b/src/renderer/src/main.ts index 2642875..abe0d57 100644 --- a/src/renderer/src/main.ts +++ b/src/renderer/src/main.ts @@ -4,6 +4,7 @@ import { createRouter, createWebHashHistory } from 'vue-router' import App from './App.vue' import { vTooltip } from './directives/tooltip' import './assets/styles/variables.css' +import './assets/styles/material3-tokens.css' import './assets/styles/base.css' const router = createRouter({ diff --git a/src/renderer/src/stores/settings.store.ts b/src/renderer/src/stores/settings.store.ts index e4cf99b..8706b0c 100644 --- a/src/renderer/src/stores/settings.store.ts +++ b/src/renderer/src/stores/settings.store.ts @@ -1,5 +1,7 @@ import { ref, watch } from 'vue' import { defineStore } from 'pinia' +import { applyMaterial3Theme } from '../utils/material3-theme' +import { hexToRgb, lightenHex, getLuminance } from '../utils/color' export type SwipeAction = 'delete' | 'toggleRead' | 'toggleFlag' | 'none' @@ -28,21 +30,16 @@ export const ACCENT_QUICK_PICKS = [ '#f87171', // red ] -function hexToRgb(hex: string): [number, number, number] | null { - const m = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(hex) - if (!m) return null - return [parseInt(m[1], 16), parseInt(m[2], 16), parseInt(m[3], 16)] +// ─── Design system ─────────────────────────────────────── +export type DesignSystem = 'liquid-glass' | 'material3' + +export const DESIGN_SYSTEM_LABELS: Record = { + 'liquid-glass': 'Liquid Glass', + material3: 'Material 3', } -function lightenHex(hex: string, amount: number): string { - const rgb = hexToRgb(hex) - if (!rgb) return hex - return '#' + rgb.map(c => Math.min(255, c + amount).toString(16).padStart(2, '0')).join('') -} - -function getLuminance(r: number, g: number, b: number): number { - return 0.2126 * (r / 255) + 0.7152 * (g / 255) + 0.0722 * (b / 255) -} +// Базовая M3-палитра Google первой, дальше — существующие акцентные цвета приложения +export const MATERIAL3_SEED_PRESETS = ['#6750A4', ...ACCENT_QUICK_PICKS] function applyAccentColor(hex: string): void { const rgb = hexToRgb(hex) @@ -67,6 +64,18 @@ function applyUiScale(scale: number): void { window.api.invoke('app:setZoom', { factor: scale }) } +// ─── Design system ─────────────────────────────────────── +// В Material 3 акцент — не отдельная настройка, а производная от M3-палитры (applyMaterial3Theme +// сама выставляет --accent из сгенерированной роли primary), поэтому applyAccentColor здесь не вызывается. +function applyDesignSystem(designSystem: DesignSystem, material3Seed: string, accentColor: string): void { + document.documentElement.dataset.design = designSystem + if (designSystem === 'material3') { + applyMaterial3Theme(material3Seed) + } else { + applyAccentColor(accentColor) + } +} + // ─── Auto-check intervals ──────────────────────────────── export const AUTO_CHECK_INTERVALS: { value: number; label: string }[] = [ { value: 0, label: 'Выключено' }, @@ -86,6 +95,8 @@ function load(): { autoCheckInterval?: number uiScale?: number downloadFolder?: string + designSystem?: DesignSystem + material3Seed?: string } { try { return JSON.parse(localStorage.getItem(STORAGE_KEY) ?? '{}') @@ -103,6 +114,8 @@ export const useSettingsStore = defineStore('settings', () => { const autoCheckInterval = ref(saved.autoCheckInterval ?? 1) const uiScale = ref(saved.uiScale ?? 1.0) const downloadFolder = ref(saved.downloadFolder ?? '') + const designSystem = ref(saved.designSystem ?? 'liquid-glass') + const material3Seed = ref(saved.material3Seed ?? MATERIAL3_SEED_PRESETS[0]) // Если папка не сохранена — подтягиваем системный Downloads if (!downloadFolder.value) { @@ -112,11 +125,12 @@ export const useSettingsStore = defineStore('settings', () => { } // Apply on init - applyAccentColor(accentColor.value) applyUiScale(uiScale.value) + applyDesignSystem(designSystem.value, material3Seed.value, accentColor.value) watch(accentColor, (hex) => { - applyAccentColor(hex) + // В Material 3 акцент производный от палитры — ручной цвет здесь не действует + if (designSystem.value === 'liquid-glass') applyAccentColor(hex) persist() }) @@ -125,6 +139,11 @@ export const useSettingsStore = defineStore('settings', () => { persist() }) + watch([designSystem, material3Seed], ([design, seed]) => { + applyDesignSystem(design, seed, accentColor.value) + persist() + }) + watch([swipeLeftAction, swipeRightAction, autoCheckInterval, downloadFolder], persist) function persist(): void { @@ -135,8 +154,19 @@ export const useSettingsStore = defineStore('settings', () => { autoCheckInterval: autoCheckInterval.value, uiScale: uiScale.value, downloadFolder: downloadFolder.value, + designSystem: designSystem.value, + material3Seed: material3Seed.value, })) } - return { swipeLeftAction, swipeRightAction, accentColor, autoCheckInterval, uiScale, downloadFolder } + return { + swipeLeftAction, + swipeRightAction, + accentColor, + autoCheckInterval, + uiScale, + downloadFolder, + designSystem, + material3Seed, + } }) diff --git a/src/renderer/src/utils/color.ts b/src/renderer/src/utils/color.ts new file mode 100644 index 0000000..eeb0397 --- /dev/null +++ b/src/renderer/src/utils/color.ts @@ -0,0 +1,15 @@ +export function hexToRgb(hex: string): [number, number, number] | null { + const m = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(hex) + if (!m) return null + return [parseInt(m[1], 16), parseInt(m[2], 16), parseInt(m[3], 16)] +} + +export function lightenHex(hex: string, amount: number): string { + const rgb = hexToRgb(hex) + if (!rgb) return hex + return '#' + rgb.map(c => Math.min(255, c + amount).toString(16).padStart(2, '0')).join('') +} + +export function getLuminance(r: number, g: number, b: number): number { + return 0.2126 * (r / 255) + 0.7152 * (g / 255) + 0.0722 * (b / 255) +} diff --git a/src/renderer/src/utils/material3-theme.ts b/src/renderer/src/utils/material3-theme.ts new file mode 100644 index 0000000..6fdee6a --- /dev/null +++ b/src/renderer/src/utils/material3-theme.ts @@ -0,0 +1,91 @@ +import { + Hct, + SchemeTonalSpot, + MaterialDynamicColors, + hexFromArgb, + argbFromHex, + type DynamicScheme +} from '@material/material-color-utilities' +import { hexToRgb, lightenHex, getLuminance } from './color' + +// Контраст по умолчанию для тёмной M3-схемы (0 = стандартный, см. references/color-system.md) +const STANDARD_CONTRAST = 0.0 + +const materialDynamicColors = new MaterialDynamicColors() + +// Роли, которые реально нужны интерфейсу (полный список 29+ ролей MD3, tone-mapping — тёмная схема) +const ROLE_GETTERS: Record number> = { + 'primary': (s) => materialDynamicColors.primary().getArgb(s), + 'on-primary': (s) => materialDynamicColors.onPrimary().getArgb(s), + 'primary-container': (s) => materialDynamicColors.primaryContainer().getArgb(s), + 'on-primary-container': (s) => materialDynamicColors.onPrimaryContainer().getArgb(s), + 'secondary': (s) => materialDynamicColors.secondary().getArgb(s), + 'on-secondary': (s) => materialDynamicColors.onSecondary().getArgb(s), + 'secondary-container': (s) => materialDynamicColors.secondaryContainer().getArgb(s), + 'on-secondary-container': (s) => materialDynamicColors.onSecondaryContainer().getArgb(s), + 'tertiary': (s) => materialDynamicColors.tertiary().getArgb(s), + 'on-tertiary': (s) => materialDynamicColors.onTertiary().getArgb(s), + 'tertiary-container': (s) => materialDynamicColors.tertiaryContainer().getArgb(s), + 'on-tertiary-container': (s) => materialDynamicColors.onTertiaryContainer().getArgb(s), + 'error': (s) => materialDynamicColors.error().getArgb(s), + 'on-error': (s) => materialDynamicColors.onError().getArgb(s), + 'error-container': (s) => materialDynamicColors.errorContainer().getArgb(s), + 'on-error-container': (s) => materialDynamicColors.onErrorContainer().getArgb(s), + 'surface': (s) => materialDynamicColors.surface().getArgb(s), + 'on-surface': (s) => materialDynamicColors.onSurface().getArgb(s), + 'on-surface-variant': (s) => materialDynamicColors.onSurfaceVariant().getArgb(s), + 'surface-container-lowest': (s) => materialDynamicColors.surfaceContainerLowest().getArgb(s), + 'surface-container-low': (s) => materialDynamicColors.surfaceContainerLow().getArgb(s), + 'surface-container': (s) => materialDynamicColors.surfaceContainer().getArgb(s), + 'surface-container-high': (s) => materialDynamicColors.surfaceContainerHigh().getArgb(s), + 'surface-container-highest': (s) => materialDynamicColors.surfaceContainerHighest().getArgb(s), + 'surface-dim': (s) => materialDynamicColors.surfaceDim().getArgb(s), + 'surface-bright': (s) => materialDynamicColors.surfaceBright().getArgb(s), + 'outline': (s) => materialDynamicColors.outline().getArgb(s), + 'outline-variant': (s) => materialDynamicColors.outlineVariant().getArgb(s), + 'inverse-surface': (s) => materialDynamicColors.inverseSurface().getArgb(s), + 'inverse-on-surface': (s) => materialDynamicColors.inverseOnSurface().getArgb(s), + 'inverse-primary': (s) => materialDynamicColors.inversePrimary().getArgb(s), + 'shadow': (s) => materialDynamicColors.shadow().getArgb(s), + 'scrim': (s) => materialDynamicColors.scrim().getArgb(s) +} + +export type Material3Tokens = Record + +// Генерирует полный набор тёмных M3 color-ролей из seed-цвета (HCT tonal-spot — та же схема, что Material You на Android) +export function generateMaterial3DarkTokens(seedHex: string): Material3Tokens { + const sourceHct = Hct.fromInt(argbFromHex(seedHex)) + const scheme = new SchemeTonalSpot(sourceHct, true, STANDARD_CONTRAST) + + const tokens: Material3Tokens = {} + for (const role in ROLE_GETTERS) { + tokens[role] = hexFromArgb(ROLE_GETTERS[role](scheme)) + } + return tokens +} + +// Применяет сгенерированные роли как CSS custom properties --md-sys-color-*, +// а также синхронизирует алиасы --accent-* (используются во всём приложении вне M3-специфичных +// стилей) с ролью primary — в Material 3 акцент не настраивается отдельно, а производится из палитры +export function applyMaterial3Theme(seedHex: string): void { + const tokens = generateMaterial3DarkTokens(seedHex) + const root = document.documentElement + for (const role in tokens) { + root.style.setProperty(`--md-sys-color-${role}`, tokens[role]) + } + + root.style.setProperty('--accent', tokens.primary) + root.style.setProperty('--accent-hover', lightenHex(tokens.primary, 24)) + root.style.setProperty('--accent-muted', tokens['primary-container']) + root.style.setProperty('--accent-text', tokens['on-primary']) + root.style.setProperty('--bg-selected', tokens['secondary-container']) + + const primaryRgb = hexToRgb(tokens.primary) + if (primaryRgb) { + const [r, g, b] = primaryRgb + root.style.setProperty('--accent-glow', `rgba(${r},${g},${b},0.08)`) + const lum = getLuminance(r, g, b) + const swipeAlpha = lum > 0.6 ? 0.45 : 0.72 + root.style.setProperty('--accent-swipe-bg', `rgba(${r},${g},${b},${swipeAlpha})`) + } +} diff --git a/src/renderer/src/views/CalendarView.vue b/src/renderer/src/views/CalendarView.vue index f37b439..f225015 100644 --- a/src/renderer/src/views/CalendarView.vue +++ b/src/renderer/src/views/CalendarView.vue @@ -726,4 +726,205 @@ function pickColor(color: string): void { border-color: rgba(255, 255, 255, 0.70); transform: scale(1.12); } + +/* ── Material 3 ── */ +html[data-design='material3'] .account-bar { + border-radius: var(--md-sys-shape-corner-large); + background: var(--md-sys-color-surface-container-low); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} + +html[data-design='material3'] .cal-sidebar { + border-radius: var(--md-sys-shape-corner-large); + background: var(--md-sys-color-surface-container-low); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} + +html[data-design='material3'] .sidebar-divider { + background: var(--md-sys-color-outline-variant); +} + +html[data-design='material3'] .cal-list-header { + font-size: var(--md-sys-typescale-label-medium-size); + line-height: var(--md-sys-typescale-label-medium-line); + font-weight: var(--md-sys-typescale-label-medium-weight); + letter-spacing: var(--md-sys-typescale-label-medium-tracking); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .cal-list-icon { + color: var(--md-sys-color-primary); +} + +html[data-design='material3'] .cal-item { + border-radius: var(--md-sys-shape-corner-full); +} + +html[data-design='material3'] .cal-item:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); +} + +html[data-design='material3'] .cal-item.active { + background: var(--md-sys-color-secondary-container); +} + +html[data-design='material3'] .cal-item.active .cal-name { + color: var(--md-sys-color-on-secondary-container); +} + +html[data-design='material3'] .cal-name { + font-size: var(--md-sys-typescale-body-medium-size); + line-height: var(--md-sys-typescale-body-medium-line); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .no-calendars { + font-size: var(--md-sys-typescale-body-small-size); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .error-icon-wrap { + background: var(--md-sys-color-error-container); + border: none; +} + +html[data-design='material3'] .error-icon { + color: var(--md-sys-color-on-error-container); +} + +html[data-design='material3'] .error-title { + font-size: var(--md-sys-typescale-label-large-size); + color: var(--md-sys-color-error); +} + +html[data-design='material3'] .error-detail { + font-size: var(--md-sys-typescale-body-small-size); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .retry-btn { + border-radius: var(--md-sys-shape-corner-full); + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline-variant); + color: var(--md-sys-color-on-surface-variant); +} +html[data-design='material3'] .retry-btn:hover:not(:disabled) { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-highest)); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .calendar-main { + border-radius: var(--md-sys-shape-corner-large); + background: var(--md-sys-color-surface); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: none; +} + +html[data-design='material3'] .toolbar { + border-bottom: 1px solid var(--md-sys-color-outline-variant); + background: var(--md-sys-color-surface-container-low); +} + +html[data-design='material3'] .nav-btn { + border-radius: var(--md-sys-shape-corner-full); + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline-variant); + color: var(--md-sys-color-on-surface-variant); +} +html[data-design='material3'] .nav-btn:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-highest)); + border-color: var(--md-sys-color-outline); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .today-btn { + border-radius: var(--md-sys-shape-corner-full); + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline-variant); + color: var(--md-sys-color-on-surface-variant); + font-size: var(--md-sys-typescale-label-large-size); +} +html[data-design='material3'] .today-btn:hover { + background: var(--md-sys-color-secondary-container); + border-color: var(--md-sys-color-secondary-container); + color: var(--md-sys-color-on-secondary-container); + box-shadow: none; +} + +html[data-design='material3'] .week-label { + font-size: var(--md-sys-typescale-title-large-size); + line-height: var(--md-sys-typescale-title-large-line); + font-weight: var(--md-sys-typescale-title-large-weight); + letter-spacing: var(--md-sys-typescale-title-large-tracking); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .icon-btn { + border-radius: var(--md-sys-shape-corner-full); + background: var(--md-sys-color-surface-container-highest); + border: 1px solid var(--md-sys-color-outline-variant); + color: var(--md-sys-color-on-surface-variant); +} +html[data-design='material3'] .icon-btn:hover:not(:disabled) { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-highest)); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .spinner { + border: 2px solid var(--md-sys-color-outline-variant); + border-top-color: var(--md-sys-color-primary); +} + +html[data-design='material3'] .empty-state { + background: color-mix(in srgb, var(--md-sys-color-scrim) 40%, transparent); +} + +html[data-design='material3'] .empty-content { + border-radius: var(--md-sys-shape-corner-extra-large); + background: var(--md-sys-color-surface-container-high); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: var(--md-sys-elevation-3); +} + +html[data-design='material3'] .empty-icon { + color: var(--md-sys-color-on-surface-variant); + opacity: 1; +} + +html[data-design='material3'] .empty-content h2 { + font-size: var(--md-sys-typescale-headline-small-size); + line-height: var(--md-sys-typescale-headline-small-line); + font-weight: var(--md-sys-typescale-headline-small-weight); + color: var(--md-sys-color-on-surface); +} + +html[data-design='material3'] .empty-content p { + font-size: var(--md-sys-typescale-body-medium-size); + color: var(--md-sys-color-on-surface-variant); +} + +html[data-design='material3'] .add-btn { + background: var(--md-sys-color-primary); + color: var(--md-sys-color-on-primary); + border-radius: var(--md-sys-shape-corner-full); + font-size: var(--md-sys-typescale-label-large-size); + box-shadow: none; +} +html[data-design='material3'] .add-btn:hover { + background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-primary)); + box-shadow: none; +} + +html[data-design='material3'] .color-picker-popover { + border-radius: var(--md-sys-shape-corner-medium); + background: var(--md-sys-color-surface-container-high); + border: 1px solid var(--md-sys-color-outline-variant); + box-shadow: var(--md-sys-elevation-3); +} + +html[data-design='material3'] .color-swatch.selected { + border-color: var(--md-sys-color-on-surface); +} diff --git a/src/renderer/src/views/ComposeView.vue b/src/renderer/src/views/ComposeView.vue index edab260..b275f14 100644 --- a/src/renderer/src/views/ComposeView.vue +++ b/src/renderer/src/views/ComposeView.vue @@ -1219,4 +1219,275 @@ const totalAttachSize = computed(() => } @keyframes spin { to { transform: rotate(360deg); } } + +/* ══════════════════════════════════════════════════════════════════════════ + Material Design 3 — переопределения (активны только под data-design=material3) + Примечание: разметка srcdoc iframe с оригинальным письмом (quoteSrcdoc в +