mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-20 03:34:06 +00:00
Add dark mode with CSS custom property theme system
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>
This commit is contained in:
@@ -22,10 +22,19 @@
|
||||
@endforeach
|
||||
|
||||
@vite('resources/scripts/main.js')
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
var theme = localStorage.getItem('theme') || 'system';
|
||||
if (theme === 'dark' || (theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
||||
document.documentElement.setAttribute('data-theme', 'dark');
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body
|
||||
class="h-full overflow-hidden bg-gray-100 font-base
|
||||
class="h-full overflow-hidden bg-surface-tertiary font-base
|
||||
@if(isset($current_theme)) theme-{{ $current_theme }} @else theme-{{get_app_setting('admin_portal_theme') ?? 'invoiceshelf'}} @endif ">
|
||||
|
||||
<!-- Module Scripts -->
|
||||
|
||||
Reference in New Issue
Block a user