fix(a11y): skip-link target, priority labels, greeting tokens
- Rename #page-content to #main-content so skip-to-content link targets the semantic <main> landmark - Add sr-only priority labels to dashboard task items for screen readers (WCAG 1.4.1 color-not-only) - Replace hardcoded hex in greeting gradient with accent tokens so dark mode themes the banner correctly - Replace hardcoded gap: 2px with --space-0h token - Bump version to 0.7.2
This commit is contained in:
@@ -56,6 +56,13 @@ function formatDueDate(dateStr) {
|
||||
};
|
||||
}
|
||||
|
||||
const PRIORITY_LABELS = () => ({
|
||||
urgent: t('tasks.priorityUrgent'),
|
||||
high: t('tasks.priorityHigh'),
|
||||
medium: t('tasks.priorityMedium'),
|
||||
low: t('tasks.priorityLow'),
|
||||
});
|
||||
|
||||
const MEAL_LABELS = () => ({
|
||||
breakfast: t('meals.typeBreakfast'),
|
||||
lunch: t('meals.typeLunch'),
|
||||
@@ -160,7 +167,8 @@ function renderUrgentTasks(tasks) {
|
||||
const due = formatDueDate(t.due_date);
|
||||
return `
|
||||
<div class="task-item" data-route="/tasks" role="button" tabindex="0">
|
||||
<div class="task-item__priority task-item__priority--${t.priority}"></div>
|
||||
<div class="task-item__priority task-item__priority--${t.priority}" aria-hidden="true"></div>
|
||||
<span class="sr-only">${PRIORITY_LABELS()[t.priority] ?? t.priority}</span>
|
||||
<div class="task-item__content">
|
||||
<div class="task-item__title">${esc(t.title)}</div>
|
||||
${due ? `<div class="task-item__meta ${due.overdue ? 'task-item__meta--overdue' : ''}">${due.text}</div>` : ''}
|
||||
|
||||
Reference in New Issue
Block a user