feat: update CSS theming and enhance variable application for improved UI consistency

- Refactored CSS styles to utilize HSL color values for better theme adaptability.
- Added custom light and dark themes with comprehensive variable definitions to ensure consistent styling across the application.
- Implemented a mechanism to force CSS variable updates, ensuring that custom themes are applied correctly during runtime.
This commit is contained in:
2025-11-23 04:58:38 -03:00
parent 467e04b605
commit 095f041891
2 changed files with 102 additions and 5 deletions

View File

@@ -171,6 +171,14 @@ export function aplicarTema(temaId: TemaId | string | null | undefined): void {
// Forçar reflow para garantir que o CSS seja aplicado
void htmlElement.offsetHeight;
// Forçar atualização de todas as variáveis CSS
// Isso garante que os temas customizados sejam aplicados corretamente
if (typeof window !== 'undefined' && window.getComputedStyle) {
const computedStyle = window.getComputedStyle(htmlElement);
// Forçar recálculo das variáveis CSS
computedStyle.getPropertyValue('--p');
}
// Disparar evento customizado para notificar mudança de tema
if (typeof window !== 'undefined') {
window.dispatchEvent(new CustomEvent('themechange', { detail: { theme: nomeDaisyUI } }));