CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
theme.ts29 linesDownload Raw Back to core
1/**2 * @license3 * Copyright 2025 Google LLC4 * SPDX-License-Identifier: Apache-2.05 */6 7import { themeManager, AUTO_THEME_NAME } from '../ui/themes/theme-manager.js';8import { type LoadedSettings } from '../config/settings.js';9import { t } from '../i18n/index.js';10 11/**12 * Validates the configured theme.13 * @param settings The loaded application settings.14 * @returns An error message if the theme is not found, otherwise null.15 */16export function validateTheme(settings: LoadedSettings): string | null {17  const effectiveTheme = settings.merged.ui?.theme;18  if (19    effectiveTheme &&20    effectiveTheme !== AUTO_THEME_NAME &&21    !themeManager.findThemeByName(effectiveTheme)22  ) {23    return t('Theme "{{themeName}}" not found.', {24      themeName: effectiveTheme,25    });26  }27  return null;28}29 
basant307/AI_Governance_Project · CoolFace