1
0
Fork 0
mirror of synced 2024-06-29 11:31:06 +12:00

Revert nav bar background to default theme color when changing client app theme, and use a unique nav background color for light theme

This commit is contained in:
Andrew Kingston 2022-01-12 15:39:20 +00:00
parent 030ff0c50e
commit 4ba0f0ded0
2 changed files with 14 additions and 2 deletions

View file

@ -1,6 +1,7 @@
<script>
import { Select } from "@budibase/bbui"
import { store } from "builderStore"
import { get } from "svelte/store"
const themeOptions = [
{
@ -20,6 +21,17 @@
value: "spectrum--darkest",
},
]
const onChangeTheme = async theme => {
await store.actions.theme.save(theme)
await store.actions.customTheme.save({
...get(store).customTheme,
navBackground:
theme === "spectrum--light"
? "var(--spectrum-global-color-gray-50)"
: "var(--spectrum-global-color-gray-100)",
})
}
</script>
<div>
@ -27,7 +39,7 @@
value={$store.theme}
options={themeOptions}
placeholder={null}
on:change={e => store.actions.theme.save(e.detail)}
on:change={e => onChangeTheme(e.detail)}
/>
</div>

View file

@ -19,7 +19,7 @@
primaryColor: "var(--spectrum-global-color-blue-600)",
primaryColorHover: "var(--spectrum-global-color-blue-500)",
buttonBorderRadius: "16px",
navBackground: "var(--spectrum-global-color-gray-100)",
navBackground: "var(--spectrum-global-color-gray-50)",
navTextColor: "var(--spectrum-global-color-gray-800)",
}