From 5c21fb1e64af16437bc9ddb9616847a7f16184c8 Mon Sep 17 00:00:00 2001 From: ulfrxdev Date: Sat, 18 Apr 2026 11:12:05 +0200 Subject: [PATCH] Extract colors --- index.html | 137 ++++++++++++++++++++++++----------- js/app.js | 10 +-- js/ui/bottomNav.js | 6 +- js/ui/ingredientCard.js | 116 +++++++++++++++--------------- js/ui/mealCalendar.js | 28 ++++---- js/ui/mealPlanEditor.js | 66 ++++++++--------- js/ui/recipeGrid.js | 22 +++--- js/ui/recipeSearchField.js | 4 +- js/views/Filter.js | 26 +++---- js/views/MealPlanner.js | 142 ++++++++++++++++++------------------- js/views/Pantry.js | 136 +++++++++++++++++------------------ js/views/RecipeDetailV2.js | 68 +++++++++--------- js/views/RecipeList.js | 24 +++---- js/views/ShoppingList.js | 130 ++++++++++++++++----------------- 14 files changed, 485 insertions(+), 430 deletions(-) diff --git a/index.html b/index.html index eece0ce..761ab0b 100644 --- a/index.html +++ b/index.html @@ -31,7 +31,6 @@ --text-primary-rgb: 28, 24, 21; --text-secondary-rgb: 102, 92, 83; --text-tertiary-rgb: 156, 146, 137; - --accent-rgb: 111, 149, 255; --warm-rgb: 183, 142, 88; --success-rgb: 98, 171, 132; --danger-rgb: 210, 116, 116; @@ -40,27 +39,66 @@ --dock-shadow: 0 24px 56px rgba(24, 17, 11, 0.18); --highlight-top: rgba(111, 149, 255, 0.14); --highlight-bottom: rgba(97, 184, 180, 0.12); + + /* Extended palette (placeholder light-mode values — light mode is WIP). */ + --card-rgb: 255, 255, 255; + --card-soft-rgb: 250, 246, 240; + --card-strong-rgb: 235, 229, 221; + --card-raised-rgb: 252, 248, 242; + --sunken-rgb: 247, 242, 236; + --sunken-deep-rgb: 235, 229, 221; + --border-card-rgb: 220, 212, 200; + --border-input-rgb: 176, 164, 150; + --text-emphasis-rgb: 14, 12, 10; + --text-body-rgb: 48, 40, 33; + --text-body-soft-rgb: 72, 62, 52; + --text-muted-rgb: 112, 102, 91; + --text-dim-rgb: 140, 130, 118; + --text-faint-rgb: 156, 146, 137; + --text-subdued-rgb: 176, 166, 154; + --skeleton-rgb: 226, 220, 210; + --on-accent-rgb: 255, 255, 255; + --overlay-rgb: 24, 17, 11; } .dark { color-scheme: dark; - --app-bg-rgb: 45, 46, 43; - --surface-rgb: 37, 35, 33; + --app-bg-rgb: 45, 46, 43; /* #2d2e2b */ + --surface-rgb: 37, 35, 33; /* panel/input backgrounds (existing tokens) */ --surface-soft-rgb: 46, 43, 40; --surface-strong-rgb: 58, 55, 51; --line-rgb: 255, 249, 239; --text-primary-rgb: 246, 241, 232; - --text-secondary-rgb: 183, 173, 161; + --text-secondary-rgb: 183, 173, 161; /* #b7ada1 */ --text-tertiary-rgb: 129, 121, 112; - --accent-rgb: 134, 171, 255; --warm-rgb: 198, 156, 101; - --success-rgb: 109, 194, 144; + --success-rgb: 110, 231, 183; /* #6ee7b7 — unified success green */ --danger-rgb: 220, 127, 127; --panel-shadow: 0 22px 56px rgba(0, 0, 0, 0.24); --panel-shadow-strong: 0 30px 82px rgba(0, 0, 0, 0.42); --dock-shadow: 0 30px 84px rgba(0, 0, 0, 0.42); --highlight-top: transparent; --highlight-bottom: transparent; + + /* Extended dark palette — distinct shades used across cards, dock, pickers, inputs. */ + --card-rgb: 57, 57, 55; /* #393937 — primary elevated card */ + --card-soft-rgb: 47, 47, 45; /* #2f2f2d — medium card */ + --card-strong-rgb: 68, 68, 66; /* #444442 — strong card / stroke */ + --card-raised-rgb: 58, 58, 55; /* #3a3a37 — slight raise above card */ + --sunken-rgb: 35, 34, 30; /* #23221e — deep inputs / search shell */ + --sunken-deep-rgb: 22, 21, 19; /* #161513 — deepest well */ + --border-card-rgb: 65, 66, 63; /* #41423f — dock/picker borders */ + --border-input-rgb: 120, 120, 118; /* #787876 — input / active borders */ + --text-emphasis-rgb: 242, 239, 232; /* #f2efe8 — brightest interactive text */ + --text-body-rgb: 221, 214, 202; /* #ddd6ca — primary body text (most common) */ + --text-body-soft-rgb: 215, 210, 200; /* #d7d2c8 — body soft */ + --text-muted-rgb: 183, 173, 161; /* #b7ada1 — muted (matches --text-secondary) */ + --text-dim-rgb: 155, 151, 143; /* #9b978f — dim / placeholder */ + --text-faint-rgb: 143, 139, 132; /* #8f8b84 — faint icon color */ + --text-subdued-rgb: 109, 108, 103; /* #6d6c67 — subdued */ + --skeleton-rgb: 212, 212, 212; /* #d4d4d4 — image loading placeholder */ + --on-accent-rgb: 26, 26, 26; /* #1a1a1a — text on bright accent backgrounds */ + --overlay-rgb: 0, 0, 0; /* scrim / shadow base */ } * { touch-action: manipulation; } @@ -84,7 +122,7 @@ height: 20px; width: 20px; border-radius: 50%; - background: rgb(var(--accent-rgb)); + background: rgb(var(--text-body-rgb)); border: 2px solid rgba(var(--surface-rgb), 0.9); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22); cursor: pointer; @@ -120,7 +158,7 @@ background: linear-gradient(180deg, rgba(var(--surface-strong-rgb), 1) 0%, rgba(var(--surface-soft-rgb), 1) 100%) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 0, 0, 0.18) !important; } - .border-gray-900 { border-color: rgba(var(--accent-rgb), 0.42) !important; } + .border-gray-900 { border-color: rgba(var(--text-body-rgb), 0.42) !important; } .bg-white\/90 { background-color: rgba(var(--surface-rgb), 0.9) !important; } .bg-white\/80 { background-color: rgba(var(--surface-rgb), 0.78) !important; } .bg-gray-50\/80 { background-color: rgba(var(--surface-soft-rgb), 0.72) !important; } @@ -146,7 +184,7 @@ .divide-red-50 > :not([hidden]) ~ :not([hidden]) { border-color: rgba(var(--danger-rgb), 0.1) !important; } .ring-gray-200 { --tw-ring-color: rgba(var(--line-rgb), 0.16) !important; } - .ring-gray-900 { --tw-ring-color: rgba(var(--accent-rgb), 0.52) !important; } + .ring-gray-900 { --tw-ring-color: rgba(var(--text-body-rgb), 0.52) !important; } .hover\:bg-gray-50:hover { background-color: rgba(var(--surface-soft-rgb), 0.94) !important; } .hover\:bg-gray-100:hover { background-color: rgba(var(--surface-strong-rgb), 0.94) !important; } @@ -159,11 +197,11 @@ .hover\:text-red-600:hover { color: rgba(var(--danger-rgb), 1) !important; } .hover\:border-gray-300:hover { border-color: rgba(var(--line-rgb), 0.28) !important; } .hover\:border-gray-400:hover { border-color: rgba(var(--line-rgb), 0.34) !important; } - .hover\:border-gray-900:hover { border-color: rgba(var(--accent-rgb), 0.54) !important; } + .hover\:border-gray-900:hover { border-color: rgba(var(--text-body-rgb), 0.54) !important; } .hover\:border-red-200:hover { border-color: rgba(var(--danger-rgb), 0.34) !important; } - .focus\:border-gray-400:focus { border-color: rgba(var(--accent-rgb), 0.54) !important; } - .focus\:border-gray-300:focus { border-color: rgba(var(--accent-rgb), 0.44) !important; } + .focus\:border-gray-400:focus { border-color: rgba(var(--text-body-rgb), 0.54) !important; } + .focus\:border-gray-300:focus { border-color: rgba(var(--text-body-rgb), 0.44) !important; } .shadow-lg { box-shadow: var(--panel-shadow-strong) !important; } .shadow-sm { box-shadow: var(--panel-shadow) !important; } @@ -213,17 +251,26 @@ .text-emerald-600 { color: rgba(var(--success-rgb), 0.94) !important; } .text-emerald-600\/80 { color: rgba(var(--success-rgb), 0.82) !important; } .text-emerald-500 { color: rgba(var(--success-rgb), 0.9) !important; } + .text-emerald-400 { color: rgb(var(--success-rgb)) !important; } + .text-emerald-300 { color: rgb(var(--success-rgb)) !important; } + .bg-emerald-400 { background-color: rgb(var(--success-rgb)) !important; } + .border-emerald-400\/40 { border-color: rgba(var(--success-rgb), 0.4) !important; } .bg-red-50 { background-color: rgba(var(--danger-rgb), 0.12) !important; } .bg-red-100 { background-color: rgba(var(--danger-rgb), 0.2) !important; } .bg-red-500 { background-color: rgba(var(--danger-rgb), 0.94) !important; } + .bg-red-400 { background-color: rgba(var(--danger-rgb), 0.82) !important; } .border-red-200\/80 { border-color: rgba(var(--danger-rgb), 0.26) !important; } .border-red-100\/80 { border-color: rgba(var(--danger-rgb), 0.16) !important; } + .border-red-300\/40 { border-color: rgba(var(--danger-rgb), 0.4) !important; } + .border-red-300\/30 { border-color: rgba(var(--danger-rgb), 0.3) !important; } .text-red-800 { color: rgba(var(--danger-rgb), 1) !important; } .text-red-600 { color: rgba(var(--danger-rgb), 0.96) !important; } .text-red-600\/80 { color: rgba(var(--danger-rgb), 0.82) !important; } .text-red-500 { color: rgba(var(--danger-rgb), 0.9) !important; } .text-red-400 { color: rgba(var(--danger-rgb), 0.78) !important; } + .text-red-300 { color: rgba(var(--danger-rgb), 0.66) !important; } + .hover\:text-red-500:hover { color: rgba(var(--danger-rgb), 0.9) !important; } /* App shell */ #main-view, @@ -235,7 +282,7 @@ #main-view > div:last-child, #recipe-grid, #planner-picker-grid { - background: #2d2e2b !important; + background: rgb(var(--app-bg-rgb)) !important; } #recipe-grid, #planner-picker-grid { @@ -250,7 +297,7 @@ #calendar-week-wrap, #calendar-month-wrap, #planner-meal-slots { - background: #2d2e2b !important; + background: rgb(var(--app-bg-rgb)) !important; } #main-view > div:first-child, #planner-view > div:first-child, @@ -262,7 +309,7 @@ /* Cards and sheets */ #recipe-grid > *, #planner-picker-grid > * { - background: #393937 !important; + background: rgb(var(--card-rgb)) !important; border: none !important; border-radius: 1.75rem !important; box-shadow: none !important; @@ -354,8 +401,8 @@ } #recipe-topbar #recipe-search-shell, #recipe-topbar #recipe-search-shell:focus-within { - background: #23221e !important; - border: 1px solid #787876 !important; + background: rgb(var(--sunken-rgb)) !important; + border: 1px solid rgb(var(--border-input-rgb)) !important; backdrop-filter: none; -webkit-backdrop-filter: none; } @@ -365,11 +412,11 @@ background: transparent !important; border: none !important; box-shadow: none !important; - color: #ddd6ca !important; - caret-color: #ddd6ca; + color: rgb(var(--text-body-rgb)) !important; + caret-color: rgb(var(--text-body-rgb)); } #recipe-topbar #recipe-search-input::placeholder { - color: #9b978f !important; + color: rgb(var(--text-dim-rgb)) !important; opacity: 1; } #recipe-topbar #recipe-filter-btn { @@ -383,8 +430,8 @@ z-index: 0; isolation: isolate; border-radius: 999px; - background: #393937 !important; - border: 1px solid #41423f !important; + background: rgb(var(--card-rgb)) !important; + border: 1px solid rgb(var(--border-card-rgb)) !important; box-shadow: 0 5px 10px rgba(0, 0, 0, 0.16), 0 14px 22px rgba(0, 0, 0, 0.24), @@ -410,8 +457,8 @@ pointer-events: none; } #planner-picker-search-shell:focus-within { - background: #393937 !important; - border: 1px solid #4a4b47 !important; + background: rgb(var(--card-rgb)) !important; + border: 1px solid rgba(var(--border-input-rgb), 0.62) !important; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.18), 0 16px 24px rgba(0, 0, 0, 0.24), @@ -427,15 +474,15 @@ border: none !important; box-shadow: none !important; backdrop-filter: none !important; - color: #dfd9cf !important; - caret-color: #dfd9cf; + color: rgb(var(--text-body-rgb)) !important; + caret-color: rgb(var(--text-body-rgb)); font-size: 15px; font-weight: 400; letter-spacing: -0.02em; } #planner-picker-search::placeholder, #pantry-search::placeholder { - color: #beb8ae !important; + color: rgba(var(--text-body-soft-rgb), 0.72) !important; opacity: 1; } #planner-picker-filter-btn { @@ -470,7 +517,7 @@ #planner-ing-backdrop, #pv2-edit-bg, #mpe-overlay { - background: rgba(7, 6, 5, 0.42) !important; + background: rgba(var(--overlay-rgb), 0.42) !important; backdrop-filter: blur(10px); } @@ -496,8 +543,8 @@ gap: 0.06rem; padding: 0.22rem; border-radius: 1.68rem; - background: #393937; - border: 1px solid #41423f; + background: rgb(var(--card-rgb)); + border: 1px solid rgb(var(--border-card-rgb)); box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.15), 0 5px 10px rgba(0, 0, 0, 0.16), @@ -528,7 +575,7 @@ align-items: center; justify-content: center; flex: 0 0 auto; - color: #ece8e0; + color: rgba(var(--text-primary-rgb), 0.94); cursor: pointer; transition: transform 160ms ease, @@ -544,14 +591,14 @@ #app-bottom-nav .nav-tab:hover, #app-bottom-nav .nav-action:hover { transform: translateY(-1px); - color: #ffffff; + color: rgb(var(--text-primary-rgb)); background: rgba(255, 255, 255, 0.04) !important; } #app-bottom-nav .nav-tab.is-active { width: 100%; height: 100%; - color: #fff; - background: #2d2e2b !important; + color: rgb(var(--text-primary-rgb)); + background: rgb(var(--app-bg-rgb)) !important; border-radius: 1.46rem; box-shadow: none !important; } @@ -563,7 +610,7 @@ outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), - 0 0 0 6px rgba(var(--accent-rgb), 0.26) !important; + 0 0 0 6px rgba(var(--text-body-rgb), 0.26) !important; } @media (max-width: 380px) { #app-bottom-nav { @@ -614,12 +661,16 @@ const savedTheme = localStorage.getItem('theme'); const useDarkTheme = savedTheme ? savedTheme === 'dark' : true; if (useDarkTheme) document.documentElement.classList.add('dark'); - document.querySelector('meta[name="theme-color"]')?.setAttribute('content', useDarkTheme ? '#2d2e2b' : '#f3efe9'); + const themeMeta = document.querySelector('meta[name="theme-color"]'); + if (themeMeta) { + const appBgRgb = getComputedStyle(document.documentElement).getPropertyValue('--app-bg-rgb').trim(); + if (appBgRgb) themeMeta.setAttribute('content', `rgb(${appBgRgb})`); + }
-
-
Ładowanie...
+
+
Ładowanie...
@@ -665,11 +716,11 @@ const appContainer = document.getElementById('app-container'); if (!appContainer) return; appContainer.innerHTML = ` -
-
-

Aplikacja nie wystartowała

-

${message}

- +
+
+

Aplikacja nie wystartowała

+

${message}

+
`; diff --git a/js/app.js b/js/app.js index ebd694c..a9390f4 100644 --- a/js/app.js +++ b/js/app.js @@ -65,11 +65,11 @@ function renderAppBootError(message) { if (!appContainer) return; appContainer.innerHTML = ` -
-
-

Nie udało się uruchomić aplikacji

-

${message}

- +
+
+

Nie udało się uruchomić aplikacji

+

${message}

+
`; diff --git a/js/ui/bottomNav.js b/js/ui/bottomNav.js index b680d3e..9f12cfd 100644 --- a/js/ui/bottomNav.js +++ b/js/ui/bottomNav.js @@ -18,7 +18,11 @@ function setupThemeToggle() { syncThemeToggleButton(btn, isDark); const meta = document.querySelector('meta[name="theme-color"]'); - if (meta) meta.setAttribute('content', isDark ? '#161513' : '#f3efe9'); + if (meta) { + const varName = isDark ? '--sunken-deep-rgb' : '--app-bg-rgb'; + const rgb = getComputedStyle(document.documentElement).getPropertyValue(varName).trim(); + if (rgb) meta.setAttribute('content', `rgb(${rgb})`); + } }); } diff --git a/js/ui/ingredientCard.js b/js/ui/ingredientCard.js index 91550ca..f9030ca 100644 --- a/js/ui/ingredientCard.js +++ b/js/ui/ingredientCard.js @@ -79,11 +79,11 @@ function mediaHtml(image, icon, sizeClass = 'w-9 h-9', radiusClass = 'rounded-lg const fit = image.endsWith('.svg') ? 'object-contain' : 'object-cover'; return ``; } - return `
`; + return `
`; } function compactMetaText(text, tone = 'default') { - const color = tone === 'success' ? '#6ee7b7' : tone === 'muted' ? '#9b978f' : '#d7d2c8'; + const color = tone === 'success' ? 'rgb(var(--success-rgb))' : tone === 'muted' ? 'rgb(var(--text-dim-rgb))' : 'rgb(var(--text-body-soft-rgb))'; return `${esc(text)}`; } @@ -154,7 +154,7 @@ export function getIngredientCardHTML({ overlayClass = 'fixed inset-0 z-[70] hidden opacity-0 transition-opacity duration-200 flex items-center justify-center p-5', overlayStyle = 'pointer-events:none; background:rgba(0,0,0,0.5);', cardClass = 'relative w-full max-w-xs rounded-2xl shadow-2xl overflow-hidden', - cardStyle = 'background:#2d2e2b; pointer-events:auto; max-height:85vh; overflow-y:auto; transform:translateY(0.75rem); opacity:0; transition:transform 220ms ease, opacity 220ms ease;', + cardStyle = 'background:rgb(var(--app-bg-rgb)); pointer-events:auto; max-height:85vh; overflow-y:auto; transform:translateY(0.75rem); opacity:0; transition:transform 220ms ease, opacity 220ms ease;', } = {}) { if (!idBase) throw new Error('getIngredientCardHTML requires idBase'); return ` @@ -162,24 +162,24 @@ export function getIngredientCardHTML({
-
+
- +
- -

+

-

- +

+
-
@@ -319,24 +319,24 @@ export function createIngredientCardController({ idBase, defaultSourceNote = 'Ze const nutritionMeta = hint ? `${unitScope} • ${hint}` : unitScope; wrap.innerHTML = ` -

Wartości odżywcze

-

${esc(nutritionMeta)}

+

Wartości odżywcze

+

${esc(nutritionMeta)}

-
-

${nutrition.kcal}

-

kcal

+
+

${nutrition.kcal}

+

kcal

-
+

${formatQty(nutrition.protein)}g

-

białko

+

białko

-
+

${formatQty(nutrition.fat)}g

-

tłuszcz

+

tłuszcz

-
+

${formatQty(nutrition.carbs)}g

-

węgl.

+

węgl.

`; } @@ -364,35 +364,35 @@ export function createIngredientCardController({ idBase, defaultSourceNote = 'Ze const actionLabel = state.stockEditorOpen ? 'Anuluj' : 'Zmień'; wrap.innerHTML = ` -

Zapas

-
+

Zapas

+
-

${esc(stockValueLabel)}

- ${stockSubLabel ? `

${esc(stockSubLabel)}

` : ''} +

${esc(stockValueLabel)}

+ ${stockSubLabel ? `

${esc(stockSubLabel)}

` : ''}
-
${state.stockEditorOpen ? ` -
+
- -
- ${usesPackStep ? `

${esc(formatQtyWithUnit(draftQty, def.pantryUnit))}

` : ''} + ${usesPackStep ? `

${esc(formatQtyWithUnit(draftQty, def.pantryUnit))}

` : ''}
- - + +
` : ''}
`; @@ -473,37 +473,37 @@ export function createIngredientCardController({ idBase, defaultSourceNote = 'Ze const actionLabel = state.shopEditorOpen ? 'Anuluj' : (hasShoppingItem ? 'Zmień' : 'Dodaj'); wrap.innerHTML = ` -

Lista zakupów

-
+

Lista zakupów

+
-

${esc(shopValueLabel)}

- ${shopSubLabel ? `

${esc(shopSubLabel)}

` : ''} +

${esc(shopValueLabel)}

+ ${shopSubLabel ? `

${esc(shopSubLabel)}

` : ''}
-
${state.shopEditorOpen ? ` -
+
- -
- ${usesPackStep ? `

${esc(formatQtyWithUnit(draftQty, def.pantryUnit))}

` : ''} + ${usesPackStep ? `

${esc(formatQtyWithUnit(draftQty, def.pantryUnit))}

` : ''}
${hasShoppingItem - ? '' + ? '' : ''} - +
` : ''}
`; @@ -611,24 +611,24 @@ export function createIngredientCardController({ idBase, defaultSourceNote = 'Ze const shoppingAmount = shoppingItem?.amount || 0; const pantryLabel = pantryQty > 0 ? `${formatQty(pantryQty)} ${unit}` : '—'; - const pantryColor = pantryQty > 0 ? '#ddd6ca' : '#6d6c67'; + const pantryColor = pantryQty > 0 ? 'rgb(var(--text-body-rgb))' : 'rgb(var(--text-subdued-rgb))'; const shoppingLabel = shoppingAmount > 0 ? `${formatQty(shoppingAmount)} ${unit}` : ''; - return ``; } @@ -649,7 +649,7 @@ export function createIngredientCardController({ idBase, defaultSourceNote = 'Ze const kitchenItems = (kitchen && kitchen.type === 'kitchen') ? kitchen.items : []; wrap.innerHTML = ` -

Produkty

+

Produkty

${products.map((product) => productRowHtml(state.ingredientId, product.id, pantry, kitchenItems)).join('')}
`; diff --git a/js/ui/mealCalendar.js b/js/ui/mealCalendar.js index aa35a0b..be84e77 100644 --- a/js/ui/mealCalendar.js +++ b/js/ui/mealCalendar.js @@ -19,7 +19,7 @@ export const CALENDAR_MONTHS_SHORT = [ export const CALENDAR_WEEKDAYS_SHORT = ['pn', 'wt', 'śr', 'cz', 'pt', 'so', 'nd']; export const CALENDAR_DAY_ATTR = 'data-calendar-day'; -export const CALENDAR_HANDLE_CLASS = 'block h-1 w-10 rounded-full bg-[#6d6c67]/75'; +export const CALENDAR_HANDLE_CLASS = 'block h-1 w-10 rounded-full bg-[rgb(var(--text-subdued-rgb))]/75'; function getCalendarDayHTML(day, meta, dayState, dayAttr, theme = {}) { const { mode, selectedDate } = meta; @@ -27,9 +27,9 @@ function getCalendarDayHTML(day, meta, dayState, dayAttr, theme = {}) { const showIndicator = !!dayState.showIndicator; const isDisabled = !!dayState.disabled; const isDimmed = !!dayState.dimmed && !isSelected; - const defaultBg = '#2f2f2d'; - const defaultBorder = '#444442'; - const defaultText = '#d7d2c8'; + const defaultBg = 'rgb(var(--card-soft-rgb))'; + const defaultBorder = 'rgb(var(--card-strong-rgb))'; + const defaultText = 'rgb(var(--text-body-soft-rgb))'; let bg; let borderColor; @@ -37,12 +37,12 @@ function getCalendarDayHTML(day, meta, dayState, dayAttr, theme = {}) { let borderClass = 'border'; if (isSelected) { - bg = theme.selectedBg || '#23221e'; - borderColor = theme.selectedBorder || '#787876'; - text = theme.selectedText || '#f2efe8'; + bg = theme.selectedBg || 'rgb(var(--sunken-rgb))'; + borderColor = theme.selectedBorder || 'rgb(var(--border-input-rgb))'; + text = theme.selectedText || 'rgb(var(--text-emphasis-rgb))'; } else if (isDimmed) { bg = theme.dimmedBg ?? theme.bg ?? defaultBg; - text = theme.dimText || '#7d7a74'; + text = theme.dimText || 'rgb(var(--text-faint-rgb))'; borderClass = 'border-0'; } else { bg = theme.bg || defaultBg; @@ -50,7 +50,7 @@ function getCalendarDayHTML(day, meta, dayState, dayAttr, theme = {}) { text = theme.text || defaultText; } - const dot = isSelected ? (theme.selectedDot || '#f2efe8') : (theme.dot || '#a59f92'); + const dot = isSelected ? (theme.selectedDot || 'rgb(var(--text-emphasis-rgb))') : (theme.dot || 'rgb(var(--text-faint-rgb))'); const opacity = isDimmed ? String(theme.dimOpacity ?? 0.72) : '1'; const borderStyle = isDimmed ? 'border:none;' : `border-color:${borderColor};`; const outerClass = `${mode === 'month' ? 'mx-auto ' : ''}flex h-[2.05rem] w-full min-w-0 max-w-full items-center justify-center rounded-full ${borderClass} text-xs font-medium transition-colors leading-tight overflow-hidden`; @@ -118,10 +118,10 @@ export function createCalendarTopbarHTML({ todayId, nextId, wrapperClass = 'px-4 pt-4 pb-3 flex items-center justify-end', - controlsStyle = 'background:#2f2f2d;border-color:#444442;', - navButtonClass = 'shrink-0 w-7 h-full flex items-center justify-center rounded-full border-0 bg-transparent text-[#d7d2c8] transition-colors', - todayButtonActiveClass = 'h-full shrink-0 inline-flex min-w-[5.75rem] max-w-[9rem] items-center justify-center rounded-full bg-transparent px-1.5 text-[10px] font-semibold leading-none tabular-nums text-[#d7d2c8] active:bg-transparent whitespace-nowrap', - todayButtonDimClass = 'h-full shrink-0 inline-flex items-center justify-center rounded-full px-2 text-[10px] font-semibold leading-none text-[#7d7a74] cursor-default', + controlsStyle = 'background:rgb(var(--card-soft-rgb));border-color:rgb(var(--card-strong-rgb));', + navButtonClass = 'shrink-0 w-7 h-full flex items-center justify-center rounded-full border-0 bg-transparent text-[rgb(var(--text-body-soft-rgb))] transition-colors', + todayButtonActiveClass = 'h-full shrink-0 inline-flex min-w-[5.75rem] max-w-[9rem] items-center justify-center rounded-full bg-transparent px-1.5 text-[10px] font-semibold leading-none tabular-nums text-[rgb(var(--text-body-soft-rgb))] active:bg-transparent whitespace-nowrap', + todayButtonDimClass = 'h-full shrink-0 inline-flex items-center justify-center rounded-full px-2 text-[10px] font-semibold leading-none text-[rgb(var(--text-faint-rgb))] cursor-default', }) { return `
@@ -168,7 +168,7 @@ export function syncCalendarTodayButton(buttonEl, isOnToday, selectedDate, optio ariaLabelCurrent = 'Widok jest ustawiony na bieżący okres', } = options; const active = buttonEl.dataset.calActiveClass - || 'h-full shrink-0 inline-flex min-w-[5.75rem] max-w-[9rem] items-center justify-center rounded-full bg-transparent px-1.5 text-[10px] font-semibold leading-none tabular-nums text-[#d7d2c8] active:bg-transparent whitespace-nowrap'; + || 'h-full shrink-0 inline-flex min-w-[5.75rem] max-w-[9rem] items-center justify-center rounded-full bg-transparent px-1.5 text-[10px] font-semibold leading-none tabular-nums text-[rgb(var(--text-body-soft-rgb))] active:bg-transparent whitespace-nowrap'; if (selectedDate != null) { buttonEl.textContent = formatCalendarSelectedDate(selectedDate); } diff --git a/js/ui/mealPlanEditor.js b/js/ui/mealPlanEditor.js index f4d986b..a65f0bf 100644 --- a/js/ui/mealPlanEditor.js +++ b/js/ui/mealPlanEditor.js @@ -37,21 +37,21 @@ const slotLabel = Object.fromEntries(MEAL_SLOTS.map((s) => [s.id, s.label])); export function getMealPlanEditorHTML() { return `