UNPKG

kui-shell

Version:

This is the monorepo for Kui, the hybrid command-line/GUI electron-based Kubernetes tool

27 lines 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const debug_1 = require("debug"); const settings_1 = require("@kui-shell/core/api/settings"); const find_1 = require("./find"); const debug = debug_1.default('core/webapp/themes/default'); function getDefault(isDarkMode = false) { let defaultTheme = settings_1.default.theme.defaultTheme; if (isDarkMode) { const darkTheme = find_1.default('Dark'); if (darkTheme) { defaultTheme = darkTheme.name; } } if (!defaultTheme) { console.error('theme bug: the theme does not set a default theme'); defaultTheme = settings_1.default.theme.themes[0] && settings_1.default.theme.themes[0].name; if (!defaultTheme) { throw new Error('SEVERE theme bug: no theme found'); } } debug('using default theme %s', defaultTheme); return defaultTheme; } exports.getDefault = getDefault; exports.default = getDefault; //# sourceMappingURL=default.js.map