impr: keep photon default theme with custom instance theme, close #541
This commit is contained in:
1 file changed
+9
-6
@@ -1,10 +1,7 @@
|
||||
import { env } from '$env/dynamic/public'
|
||||
import type { Theme, ThemeColors } from './colors.svelte'
|
||||
|
||||
export function getDefaultColors(): ThemeColors {
|
||||
return env.PUBLIC_THEME
|
||||
? JSON.parse(env.PUBLIC_THEME)
|
||||
: {
|
||||
const PHOTON_DEFAULT = {
|
||||
slate: {
|
||||
25: '252 253 254',
|
||||
50: '248 250 252',
|
||||
@@ -41,19 +38,25 @@ export function getDefaultColors(): ThemeColors {
|
||||
black: '0 0 0',
|
||||
white: '255 255 255',
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export function getDefaultColors(): ThemeColors {
|
||||
return env.PUBLIC_THEME ? JSON.parse(env.PUBLIC_THEME) : PHOTON_DEFAULT
|
||||
}
|
||||
|
||||
export function getDefaultTheme(): Theme {
|
||||
return {
|
||||
id: 0,
|
||||
colors: getDefaultColors(),
|
||||
name: 'Default',
|
||||
name: env.PUBLIC_THEME ? 'Instance Default' : 'Mono',
|
||||
}
|
||||
}
|
||||
|
||||
export const presets: Theme[] = [
|
||||
getDefaultTheme(),
|
||||
...(env.PUBLIC_THEME
|
||||
? [{ colors: PHOTON_DEFAULT, id: -10, name: 'Mono' }]
|
||||
: []),
|
||||
{
|
||||
colors: {
|
||||
slate: {
|
||||
|
||||
Reference in new issue
Block a user