feat: update color handling for dark mode compatibility
- Updated various components to utilize `getAdaptiveLabelColor` for dynamic label color adjustments based on the current theme. - Enhanced dark mode styles in `globals.css` for better visual consistency across components. Made-with: Cursor
This commit is contained in:
18
frontend/lib/utils/darkModeColor.ts
Normal file
18
frontend/lib/utils/darkModeColor.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* 다크모드 대응 색상 유틸리티
|
||||
* 화면 디자이너에서 기본값으로 저장된 어두운 색상을 감지하여
|
||||
* 다크모드에서 자동으로 CSS 변수(foreground)로 대체
|
||||
*/
|
||||
|
||||
const DEFAULT_DARK_COLORS = new Set([
|
||||
"#212121", "#000000", "#333333", "#333", "#000",
|
||||
"black", "#111111", "#1a1a1a", "#64748b",
|
||||
]);
|
||||
|
||||
export const isDefaultDarkLabelColor = (color?: string): boolean => {
|
||||
if (!color) return true;
|
||||
return DEFAULT_DARK_COLORS.has(color.toLowerCase().trim());
|
||||
};
|
||||
|
||||
export const getAdaptiveLabelColor = (labelColor?: string): string =>
|
||||
isDefaultDarkLabelColor(labelColor) ? "hsl(var(--foreground))" : labelColor!;
|
||||
Reference in New Issue
Block a user