@@ -26,12 +26,14 @@ export default function CustomizePage(): ReactElement {
2626 const trimmedUsername = username . trim ( ) ;
2727 const hasUsername = trimmedUsername . length > 0 ;
2828 const isAutoTheme = theme === 'auto' ;
29+ const isRandomTheme = theme === 'random' ;
30+ const skipsCustomColors = isAutoTheme || isRandomTheme ;
2931
30- // Clear custom hex overrides when switching to auto — fixed colors
31- // conflict with the dual- palette prefers-color-scheme switching .
32+ // Clear custom hex overrides when switching to virtual themes because
33+ // fixed colors conflict with their palette-selection behavior .
3234 const handleThemeChange = useCallback ( ( newTheme : string ) : void => {
3335 setTheme ( newTheme ) ;
34- if ( newTheme === 'auto' ) {
36+ if ( newTheme === 'auto' || newTheme === 'random' ) {
3537 setBgHex ( '' ) ;
3638 setAccentHex ( '' ) ;
3739 setTextHex ( '' ) ;
@@ -47,9 +49,9 @@ export default function CustomizePage(): ReactElement {
4749 params . set ( 'user' , trimmedUsername ) ;
4850 }
4951
50- if ( isAutoTheme ) {
51- // Auto always emits theme=auto — no custom color params
52- params . set ( 'theme' , 'auto' ) ;
52+ if ( skipsCustomColors ) {
53+ // Virtual themes always emit theme=<name> and skip custom color params.
54+ params . set ( 'theme' , theme ) ;
5355 } else {
5456 const hasCustomColors = bgHex || accentHex || textHex ;
5557
@@ -72,7 +74,7 @@ export default function CustomizePage(): ReactElement {
7274 hasUsername ,
7375 trimmedUsername ,
7476 theme ,
75- isAutoTheme ,
77+ skipsCustomColors ,
7678 bgHex ,
7779 accentHex ,
7880 textHex ,
@@ -260,7 +262,9 @@ export default function CustomizePage(): ReactElement {
260262
261263 < p className = "mt-3 text-[11px] text-white/20 text-center" >
262264 { hasUsername
263- ? 'Preview updates on every change. Hosted badge is cached at UTC midnight'
265+ ? isRandomTheme
266+ ? 'Random theme changes on every page load and disables caching'
267+ : 'Preview updates on every change. Hosted badge is cached at UTC midnight'
264268 : 'Add a username to enable live preview and export snippets' }
265269 </ p >
266270 </ div >
0 commit comments