mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
af8f55976f
Add a Style setting beside mode, accent, radius and background. Nostalgia restyles the app through tokens only (neutral surface palettes, system type, flat shell, top glow) and pins background, opacity and brightness. Add a top glow reach slider for both styles. Tidy the theme layer first: charts read live tokens, bare `rounded` follows the radius scale, one shared sign-in toolbar. Also carries the settings page header redesign.
39 lines
1.1 KiB
Vue
39 lines
1.1 KiB
Vue
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
|
|
const props = withDefaults(
|
|
defineProps<{
|
|
variant?: 'count' | 'progress' | 'dot'
|
|
/** `accent` marks a count that stands for outstanding work, not just a total. */
|
|
tone?: 'default' | 'accent'
|
|
label?: string
|
|
}>(),
|
|
{ variant: 'count', tone: 'default', label: undefined },
|
|
)
|
|
|
|
const inkClass = computed(() => {
|
|
if (props.tone === 'accent') return 'font-bold text-primary'
|
|
if (props.variant === 'progress') return 'font-semibold text-primary'
|
|
return 'group-data-[active=true]/item:text-primary'
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<span
|
|
v-if="variant === 'dot'"
|
|
class="ml-auto h-1.5 w-1.5 shrink-0 rounded-full bg-primary group-data-[collapsible=icon]:hidden"
|
|
:role="label ? 'img' : undefined"
|
|
:aria-label="label"
|
|
:aria-hidden="label ? undefined : 'true'"
|
|
/>
|
|
<span
|
|
v-else
|
|
class="sidebar-count ml-auto shrink-0 rounded-md px-1.5 py-0.5 tabular-nums transition-colors duration-150 group-data-[collapsible=icon]:hidden"
|
|
:class="inkClass"
|
|
:aria-label="label"
|
|
:title="label"
|
|
>
|
|
<slot />
|
|
</span>
|
|
</template>
|