wip: not loading themes until reload, missing in dashboard, bad alignment and scaling
This commit is contained in:
51
src/lib/utils/themes.ts
Normal file
51
src/lib/utils/themes.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Theme configuration for SVG overlays
|
||||
*/
|
||||
|
||||
export type ThemePattern = 'waves' | 'geometric' | 'dots' | 'none';
|
||||
|
||||
export interface Theme {
|
||||
name: string;
|
||||
pattern: ThemePattern;
|
||||
opacity: number;
|
||||
}
|
||||
|
||||
export const AVAILABLE_THEMES: Record<string, Theme> = {
|
||||
none: {
|
||||
name: 'None',
|
||||
pattern: 'none',
|
||||
opacity: 0
|
||||
},
|
||||
waves: {
|
||||
name: 'Waves',
|
||||
pattern: 'waves',
|
||||
opacity: 0.1
|
||||
},
|
||||
geometric: {
|
||||
name: 'Geometric',
|
||||
pattern: 'geometric',
|
||||
opacity: 0.1
|
||||
},
|
||||
dots: {
|
||||
name: 'Dots',
|
||||
pattern: 'dots',
|
||||
opacity: 0.15
|
||||
}
|
||||
};
|
||||
|
||||
export const DEFAULT_THEME = 'none';
|
||||
|
||||
export function getTheme(themeName?: string | null): Theme {
|
||||
if (!themeName || !AVAILABLE_THEMES[themeName]) {
|
||||
return AVAILABLE_THEMES[DEFAULT_THEME];
|
||||
}
|
||||
return AVAILABLE_THEMES[themeName];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color from a CSS color string or class
|
||||
* For now, we'll use currentColor which inherits from the parent
|
||||
*/
|
||||
export function getThemeColor(color?: string | null): string {
|
||||
return color || 'currentColor';
|
||||
}
|
||||
Reference in New Issue
Block a user