feat: custom theming enhancements (#8342)

This commit is contained in:
Anmol Singh Bhatia 2025-12-16 18:17:59 +05:30 committed by GitHub
parent be1113b170
commit fa63964566
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 1203 additions and 465 deletions

View file

@ -0,0 +1,21 @@
/**
* Legacy Theme System
*
* This file contains the old 5-color theme system for backward compatibility.
*
* @deprecated Most functions in this file are deprecated
* New code should use the OKLCH-based theme system from ./theme/ instead
*
* Functions:
* - applyTheme: OLD 5-color theme system (background, text, primary, sidebarBg, sidebarText)
* - unsetCustomCssVariables: Clears both old AND new theme variables (updated for OKLCH)
* - resolveGeneralTheme: Utility to resolve theme mode (still useful)
* - migrateLegacyTheme: Converts old 5-color theme to new 2-color system
*
* For new implementations:
* - Use: import { applyCustomTheme, clearCustomTheme } from '@plane/utils/theme'
* - See: packages/utils/src/theme/theme-application.ts
*/
export const resolveGeneralTheme = (resolvedTheme: string | undefined) =>
resolvedTheme?.includes("light") ? "light" : resolvedTheme?.includes("dark") ? "dark" : "system";