@@ -20,28 +20,6 @@ import { getApiBaseUrl } from '@/utils/apiUrl'
2020const STORAGE_KEY = 'synthstack-theme'
2121const API_BASE = getApiBaseUrl ( )
2222
23- // Light mode "safe" mode is enabled for presets that use light backgrounds and
24- // have been observed to flicker in Chrome; a few "flashy" presets are excluded.
25- const LIGHT_MODE_FLASHY_PRESETS = new Set ( [ 'brutalist' , 'cyberpunk' , 'terminal' ] )
26-
27- type LightSafeOverride = 'force' | 'disable' | null
28-
29- function getLightSafeOverride ( ) : LightSafeOverride {
30- if ( typeof window === 'undefined' ) return null
31- try {
32- const params = new URLSearchParams ( window . location . search )
33- const value = params . get ( 'lightSafe' )
34- if ( value === null ) return null
35-
36- const normalized = value . trim ( ) . toLowerCase ( )
37- if ( normalized === '' || [ '1' , 'true' , 'on' , 'yes' ] . includes ( normalized ) ) return 'force'
38- if ( [ '0' , 'false' , 'off' , 'no' ] . includes ( normalized ) ) return 'disable'
39- return 'force'
40- } catch {
41- return null
42- }
43- }
44-
4523const THEME_DEBUG_SELECTORS : Record < string , string > = {
4624 app : '#q-app' ,
4725 layout : '.q-layout' ,
@@ -282,17 +260,6 @@ export const useThemeStore = defineStore('theme', () => {
282260 /** Whether dark mode is active */
283261 const isDark = computed ( ( ) => resolvedMode . value === 'dark' )
284262
285- /** Whether the landing page light-safe mode is enabled */
286- const isLightSafe = computed ( ( ) => {
287- if ( resolvedMode . value !== 'light' ) return false
288-
289- const override = getLightSafeOverride ( )
290- if ( override === 'force' ) return true
291- if ( override === 'disable' ) return false
292-
293- return ! LIGHT_MODE_FLASHY_PRESETS . has ( currentPresetSlug . value )
294- } )
295-
296263 /** Current theme slug (alias for preset slug) */
297264 const themeSlug = computed ( ( ) => currentPresetSlug . value )
298265
@@ -552,7 +519,6 @@ export const useThemeStore = defineStore('theme', () => {
552519 const isDarkMode = resolvedMode . value === 'dark'
553520 const expectedPreset = preset . slug
554521 const expectedMode = isDarkMode ? 'dark' : 'light'
555- const expectedLightSafe = isLightSafe . value
556522
557523 // Avoid redundant re-application when the DOM already matches the desired state.
558524 const bodyOk =
@@ -562,8 +528,7 @@ export const useThemeStore = defineStore('theme', () => {
562528 root . classList . contains ( 'dark' ) === isDarkMode &&
563529 root . classList . contains ( 'light' ) === ! isDarkMode &&
564530 root . getAttribute ( 'data-preset' ) === expectedPreset &&
565- root . getAttribute ( 'data-theme' ) === expectedPreset &&
566- ( expectedLightSafe ? root . getAttribute ( 'data-light-safe' ) === '1' : ! root . hasAttribute ( 'data-light-safe' ) )
531+ root . getAttribute ( 'data-theme' ) === expectedPreset
567532
568533 if ( bodyOk && rootOk ) {
569534 if ( isDebugEnabled ( 'theme' ) ) {
@@ -602,11 +567,6 @@ export const useThemeStore = defineStore('theme', () => {
602567 root . setAttribute ( 'data-theme' , preset . slug )
603568 root . setAttribute ( 'data-preset' , preset . slug )
604569
605- // Light mode "safe" mode flag (used for CSS guardrails on landing page)
606- const lightSafe = isLightSafe . value
607- if ( lightSafe ) root . setAttribute ( 'data-light-safe' , '1' )
608- else root . removeAttribute ( 'data-light-safe' )
609-
610570 // Generate and apply CSS variables
611571 const vars = generateCSSVariables ( preset , isDarkMode )
612572 Object . entries ( vars ) . forEach ( ( [ key , value ] ) => {
@@ -807,7 +767,6 @@ export const useThemeStore = defineStore('theme', () => {
807767 currentTheme,
808768 colorMode,
809769 resolvedMode,
810- isLightSafe,
811770 presets,
812771 customThemes,
813772 settings,
0 commit comments