({ name = '', color_mode = '' } = {})
| 62 | } |
| 63 | |
| 64 | function filterTheme({ name = '', color_mode = '' } = {}): SupportedTheme | undefined { |
| 65 | if (Object.values<string>(SupportedTheme).includes(name)) { |
| 66 | return name as SupportedTheme |
| 67 | } |
| 68 | if (Object.values<string>(SupportedTheme).includes(color_mode)) { |
| 69 | return color_mode as SupportedTheme |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | export function getCssTheme(cookieValue = ''): CssColorTheme { |
| 74 | if (!cookieValue) return defaultCSSTheme |