mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-15 17:24:10 +00:00
Define 13 semantic color tokens (surface, text, border, hover) with light/dark values in themes.css. Register with Tailwind via @theme inline. Migrate all 335 Vue files from hardcoded gray/white classes to semantic tokens. Add theme toggle (sun/moon/system) in user avatar dropdown. Replace @tailwindcss/forms with custom form reset using theme vars. Add status badge and alert tokens for dark mode. Theme-aware chart grid/labels, skeleton placeholders, and editor. Inline script in <head> prevents flash of wrong theme on load. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
67 lines
1.3 KiB
Vue
67 lines
1.3 KiB
Vue
<template>
|
|
<router-link
|
|
v-if="!loading"
|
|
class="
|
|
relative
|
|
flex
|
|
justify-between
|
|
p-5
|
|
bg-surface
|
|
rounded-xl
|
|
shadow
|
|
border border-line-light
|
|
hover:shadow-md
|
|
transition-shadow
|
|
xl:p-6
|
|
lg:col-span-2
|
|
"
|
|
:class="{ 'lg:!col-span-3': large }"
|
|
:to="route"
|
|
>
|
|
<div>
|
|
<span class="text-2xl font-bold leading-tight text-heading xl:text-3xl">
|
|
<slot />
|
|
</span>
|
|
<span class="block mt-1 text-sm font-medium leading-tight text-muted xl:text-base">
|
|
{{ label }}
|
|
</span>
|
|
</div>
|
|
<div class="flex items-center">
|
|
<component :is="iconComponent" class="w-10 h-10 xl:w-12 xl:h-12" />
|
|
</div>
|
|
</router-link>
|
|
|
|
<StatsCardPlaceholder v-else-if="large" />
|
|
|
|
<StatsCardSmPlaceholder v-else />
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
import StatsCardPlaceholder from './DashboardStatsPlaceholder.vue'
|
|
import StatsCardSmPlaceholder from './DashboardStatsSmPlaceholder.vue'
|
|
|
|
defineProps({
|
|
iconComponent: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
loading: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
route: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
label: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
large: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
})
|
|
</script>
|