1
0
mirror of https://github.com/TandoorRecipes/recipes.git synced 2026-01-11 09:07:12 -05:00

fixed custom CSS problem after build

This commit is contained in:
vabene1111
2025-07-11 18:44:40 +02:00
parent 70d40f9e70
commit be8a340a0c
6 changed files with 179 additions and 181 deletions

View File

@@ -1,12 +1,11 @@
import {acceptHMRUpdate, defineStore} from 'pinia'
import {useStorage} from "@vueuse/core";
import {ErrorMessageType, PreparedMessage, useMessageStore} from "@/stores/MessageStore";
import {ApiApi, ServerSettings, Space, Supermarket, UserPreference, UserSpace} from "@/openapi";
import {ApiApi, ServerSettings, Space, UserPreference, UserSpace} from "@/openapi";
import {ShoppingGroupingOptions} from "@/types/Shopping";
import {computed, ComputedRef, ref} from "vue";
import {DeviceSettings} from "@/types/settings";
import {useTheme} from "vuetify";
import tandoorDarkCustomCss from '@/assets/tandoor_dark.css?inline'
const DEVICE_SETTINGS_KEY = 'TANDOOR_DEVICE_SETTINGS'
const USER_PREFERENCE_KEY = 'TANDOOR_USER_PREFERENCE'
@@ -209,23 +208,10 @@ export const useUserPreferenceStore = defineStore('user_preference_store', () =>
* applies user settings regarding themes/styling
*/
function updateTheme() {
let customStyleTag = document.getElementById('id_style_custom_css')
if (userSettings.value.theme == 'TANDOOR') {
theme.global.name.value = 'light'
if (customStyleTag) {
document.head.removeChild(customStyleTag)
}
theme.change('light')
} else if (userSettings.value.theme == 'TANDOOR_DARK') {
theme.global.name.value = 'dark'
if (!customStyleTag) {
const styleTag = document.createElement('style')
styleTag.id = "id_style_custom_css"
styleTag.innerHTML = tandoorDarkCustomCss
document.head.appendChild(styleTag)
}
theme.change('dark')
}
}