diff --git a/packages/editor-ui/src/App.vue b/packages/editor-ui/src/App.vue index f9e40416bc..d864af4ce3 100644 --- a/packages/editor-ui/src/App.vue +++ b/packages/editor-ui/src/App.vue @@ -30,7 +30,7 @@ import Modals from './components/Modals.vue'; import LoadingView from './views/LoadingView.vue'; import Telemetry from './components/Telemetry.vue'; -import { HIRING_BANNER, VIEWS } from './constants'; +import { HIRING_BANNER, LOCAL_STORAGE_THEME, VIEWS } from './constants'; import mixins from 'vue-typed-mixins'; import { showMessage } from './components/mixins/showMessage'; @@ -159,8 +159,15 @@ export default mixins( this.$router.replace(redirect); } }, + setTheme() { + const theme = window.localStorage.getItem(LOCAL_STORAGE_THEME); + if (theme) { + window.document.body.classList.add(`theme-${theme}`); + } + }, }, async mounted() { + this.setTheme(); await this.initialize(); this.logHiringBanner(); this.authenticate(); diff --git a/packages/editor-ui/src/constants.ts b/packages/editor-ui/src/constants.ts index 6624cb4a6d..3fa9c5912f 100644 --- a/packages/editor-ui/src/constants.ts +++ b/packages/editor-ui/src/constants.ts @@ -249,6 +249,7 @@ export const LOCAL_STORAGE_PIN_DATA_DISCOVERY_NDV_FLAG = 'N8N_PIN_DATA_DISCOVERY export const LOCAL_STORAGE_PIN_DATA_DISCOVERY_CANVAS_FLAG = 'N8N_PIN_DATA_DISCOVERY_CANVAS'; export const LOCAL_STORAGE_MAPPING_FLAG = 'N8N_MAPPING_ONBOARDED'; export const LOCAL_STORAGE_MAIN_PANEL_RELATIVE_WIDTH = 'N8N_MAIN_PANEL_RELATIVE_WIDTH'; +export const LOCAL_STORAGE_THEME = 'N8N_THEME'; export const BASE_NODE_SURVEY_URL = 'https://n8n-community.typeform.com/to/BvmzxqYv#nodename='; export const HIRING_BANNER = `