Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s 🚀
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
782 B

import { derived } from "svelte/store"
import { appStore } from "./app"
import { builderStore } from "./builder"
const createThemeStore = () => {
const store = derived(
[builderStore, appStore],
([$builderStore, $appStore]) => {
const theme =
$builderStore.theme || $appStore.application?.theme || "spectrum--light"
const customTheme =
$builderStore.customTheme || $appStore.application?.customTheme || {}
let customThemeCss = ""
Object.entries(customTheme).forEach(([key, value]) => {
customThemeCss += `--${key}:${value};`
})
return {
theme,
customTheme,
customThemeCss,
}
}
)
return {
subscribe: store.subscribe,
}
}
export const themeStore = createThemeStore()