diff --git a/apps/showcase/components/layout/AppDesigner.vue b/apps/showcase/components/layout/AppDesigner.vue index 45ce74629..72c43192d 100644 --- a/apps/showcase/components/layout/AppDesigner.vue +++ b/apps/showcase/components/layout/AppDesigner.vue @@ -13,17 +13,23 @@
Built-in Themes + Four alternatives to choose from.
OR -
- Import Figma Tokens - +
+ Load Theme + Continue editing the theme files stored locally. +
OR -
- Saved Theme -
@@ -120,18 +126,9 @@ export default { }; }, mounted() { - const savedTheme = localStorage.getItem(this.$appState.designerKey); - - if (savedTheme) { - this.preset = JSON.parse(savedTheme).defaultTheme; - setTimeout(() => { - usePreset(this.preset); - }, 2000); - } else { - this.preset.semantic.primary = this.preset.primitive.emerald; - this.preset.semantic.colorScheme.light.surface = { ...{ 0: '#ffffff' }, ...this.preset.primitive.slate }; - this.preset.semantic.colorScheme.dark.surface = { ...{ 0: '#ffffff' }, ...this.preset.primitive.zinc }; - } + this.preset.semantic.primary = this.preset.primitive.emerald; + this.preset.semantic.colorScheme.light.surface = { ...{ 0: '#ffffff' }, ...this.preset.primitive.slate }; + this.preset.semantic.colorScheme.dark.surface = { ...{ 0: '#ffffff' }, ...this.preset.primitive.zinc }; }, methods: { apply() { @@ -194,6 +191,14 @@ app.mount("#app"); }; localStorage.setItem(this.$appState.designerKey, JSON.stringify(themeRecord)); + }, + loadFromLocalStorage() { + const savedTheme = localStorage.getItem(this.$appState.designerKey); + + if (savedTheme) { + this.preset = JSON.parse(savedTheme).defaultTheme; + this.$toast.add({ severity: 'success', summary: 'Success', detail: 'Theme loaded to Designer', life: 3000 }); + } } } }; diff --git a/apps/showcase/components/layout/designer/DesignTokenField.vue b/apps/showcase/components/layout/designer/DesignTokenField.vue index 40315a1fa..c62cfc00e 100644 --- a/apps/showcase/components/layout/designer/DesignTokenField.vue +++ b/apps/showcase/components/layout/designer/DesignTokenField.vue @@ -1,7 +1,22 @@ @@ -9,6 +24,32 @@