forked from mirror/crumbs-original
Remove ThemeToggle component, theme store, dark: Tailwind variants, and dark color values from NOTE_COLORS. Simplify color logic to use a single bg property. Delete dark mode e2e tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 lines
761 B
Svelte
25 lines
761 B
Svelte
<script lang="ts">
|
|
import { NOTE_COLORS, COLOR_OPTIONS } from '$lib/utils/colors.js';
|
|
import type { NoteColor } from '$lib/types/index.js';
|
|
|
|
interface Props {
|
|
selected: NoteColor;
|
|
onSelect: (color: NoteColor) => void;
|
|
}
|
|
|
|
let { selected, onSelect }: Props = $props();
|
|
</script>
|
|
|
|
<div class="flex flex-wrap gap-1" data-testid="color-picker">
|
|
{#each COLOR_OPTIONS as option}
|
|
{@const colors = NOTE_COLORS[option.value]}
|
|
<button
|
|
onclick={() => onSelect(option.value)}
|
|
class="h-8 w-8 rounded-full border-2 transition-transform hover:scale-110 {selected === option.value ? 'border-gray-800' : 'border-transparent'}"
|
|
style="background-color: {colors.bg}"
|
|
title={option.label}
|
|
data-testid="color-{option.value}"
|
|
></button>
|
|
{/each}
|
|
</div>
|