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>
42 lines
1.1 KiB
Vue
42 lines
1.1 KiB
Vue
<template>
|
|
<span :class="[badgeColorClasses, defaultClass]" class="">
|
|
<slot />
|
|
</span>
|
|
</template>
|
|
|
|
<script>
|
|
import { computed } from 'vue'
|
|
|
|
export default {
|
|
props: {
|
|
status: {
|
|
type: String,
|
|
required: false,
|
|
default: '',
|
|
},
|
|
defaultClass: {
|
|
type: String,
|
|
default: 'px-1 py-0.5 text-xs',
|
|
},
|
|
},
|
|
|
|
setup(props) {
|
|
const badgeColorClasses = computed(() => {
|
|
switch (props.status) {
|
|
case 'PAID':
|
|
return 'bg-primary-300/25 text-primary-800 uppercase font-normal text-center'
|
|
case 'UNPAID':
|
|
return ' bg-yellow-500/25 text-status-yellow uppercase font-normal text-center '
|
|
case 'PARTIALLY_PAID':
|
|
return 'bg-blue-400/25 text-status-blue uppercase font-normal text-center'
|
|
case 'OVERDUE':
|
|
return 'bg-red-300/50 px-2 py-1 text-sm text-status-red uppercase font-normal text-center'
|
|
default:
|
|
return 'bg-surface-secondary0/25 text-heading uppercase font-normal text-center'
|
|
}
|
|
})
|
|
return { badgeColorClasses }
|
|
},
|
|
}
|
|
</script>
|