fix: resolve design token violations and locale bug
- Add --color-warning-translucent and --color-soon tokens to tokens.css - Replace hardcoded font-size 1.4rem with var(--text-xl) in dashboard.css - Replace hardcoded rgba color with var(--color-warning-translucent) - Remove duplicate .task-item__meta--overdue rule - Fix hardcoded 'de-DE' locale: use formatTime() from i18n.js - Fix formatDueDate: don't show time (23:59) when no due_time is set Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -96,7 +96,7 @@ function formatDueDate(dateStr, timeStr) {
|
||||
}
|
||||
|
||||
if (calDayDiff === 0) {
|
||||
return { text: `${t('dashboard.dueToday')} – ${formatTime(dueDate)}`, overdue: false, soon: true };
|
||||
return { text: timeStr ? `${t('dashboard.dueToday')} – ${formatTime(dueDate)}` : t('dashboard.dueToday'), overdue: false, soon: true };
|
||||
}
|
||||
|
||||
if (calDayDiff === 1) {
|
||||
@@ -195,7 +195,7 @@ function renderGreeting(user, stats = {}) {
|
||||
${t('dashboard.todayMealChip', { title: esc(todayMealTitle) })}
|
||||
</span>`);
|
||||
|
||||
let time = new Date().toLocaleTimeString('de-DE', { hour: '2-digit', minute: '2-digit' });
|
||||
const time = formatTime(new Date());
|
||||
|
||||
return `
|
||||
<div class="widget-greeting">
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.widget-greeting__title {
|
||||
font-size: 1.4rem;
|
||||
font-size: var(--text-xl);
|
||||
opacity: 0.85;
|
||||
white-space: nowrap;
|
||||
padding-top: 4px;
|
||||
@@ -155,7 +155,7 @@
|
||||
}
|
||||
|
||||
.greeting-chip--due {
|
||||
background: rgba(245, 158, 11, 0.28);
|
||||
background: var(--color-warning-translucent);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------
|
||||
@@ -341,11 +341,6 @@
|
||||
font-weight: var(--font-weight-medium);
|
||||
}
|
||||
|
||||
.task-item__meta--overdue {
|
||||
color: var(--color-danger);
|
||||
font-weight: var(--font-weight-medium);
|
||||
}
|
||||
|
||||
.task-item__avatar {
|
||||
width: var(--space-5);
|
||||
height: var(--space-5);
|
||||
|
||||
@@ -221,6 +221,8 @@
|
||||
--color-glass-hover: rgba(255, 255, 255, 0.3);
|
||||
--color-glass-border: rgba(255, 255, 255, 0.15);
|
||||
--color-danger-translucent: rgba(255, 59, 48, 0.35);
|
||||
--color-warning-translucent: rgba(245, 158, 11, 0.28);
|
||||
--color-soon: var(--color-warning);
|
||||
|
||||
/* --------------------------------------------------------
|
||||
* 8. Schatten
|
||||
|
||||
Reference in New Issue
Block a user