@@ -186,7 +186,7 @@ function assertClerkIsLoaded(c: ClerkType | undefined): asserts c is ClerkType {
186186function mountIndex ( element : HTMLDivElement ) {
187187 assertClerkIsLoaded ( Clerk ) ;
188188 const user = Clerk . user ;
189- element . innerHTML = `<pre class="text-left whitespace-pre overflow-x-auto bg-white p-4 border border-gray-100 rounded-md text-sm"><code>${ JSON . stringify ( { user } , null , 2 ) } </code></pre>` ;
189+ element . innerHTML = `<pre class="text-left whitespace-pre overflow-x-auto text-muted-foreground p-4 border border-[var(--color-sidebar-border)] rounded-md text-sm"><code>${ JSON . stringify ( { user } , null , 2 ) } </code></pre>` ;
190190}
191191
192192function mountOpenButton ( element : HTMLDivElement , label : string , openFn : ( props : any ) => void , props : any ) {
@@ -301,8 +301,17 @@ async function initControls() {
301301 varFolder . addBinding ( PARAMS , 'borderRadius' ) . on ( 'change' , applyVariables ) ;
302302 varFolder . addButton ( { title : 'Reset' } ) . on ( 'click' , ( ) => {
303303 Object . assign ( PARAMS , VARIABLE_DEFAULTS ) ;
304+ for ( const key of Object . keys ( VARIABLE_DEFAULTS ) ) {
305+ sessionStorage . removeItem ( key ) ;
306+ }
304307 pane . refresh ( ) ;
305- applyVariables ( ) ;
308+ const currentAppearance = Clerk . __internal_getOption ( 'appearance' ) ?? { } ;
309+ void Clerk . __internal_updateProps ( {
310+ appearance : {
311+ ...currentAppearance ,
312+ variables : undefined ,
313+ } ,
314+ } ) ;
306315 } ) ;
307316
308317 // Options folder
@@ -467,8 +476,11 @@ void (async () => {
467476 }
468477
469478 const initialVariables : Record < string , string > = { } ;
470- for ( const [ key , def ] of Object . entries ( VARIABLE_DEFAULTS ) ) {
471- initialVariables [ key ] = sessionStorage . getItem ( key ) ?? def ;
479+ for ( const key of Object . keys ( VARIABLE_DEFAULTS ) ) {
480+ const stored = sessionStorage . getItem ( key ) ;
481+ if ( stored !== null ) {
482+ initialVariables [ key ] = stored ;
483+ }
472484 }
473485
474486 const initialLocale = sessionStorage . getItem ( 'localization' ) ?? 'enUS' ;
@@ -479,7 +491,11 @@ void (async () => {
479491 signUpUrl : '/sign-up' ,
480492 ui : { ClerkUI : window . __internal_ClerkUICtor } ,
481493 appearance : {
482- ...( initialTheme ? { theme : initialTheme } : { variables : initialVariables } ) ,
494+ ...( initialTheme
495+ ? { theme : initialTheme }
496+ : Object . keys ( initialVariables ) . length > 0
497+ ? { variables : initialVariables }
498+ : { } ) ,
483499 ...( Object . keys ( initialAppearanceOptions ) . length ? { options : initialAppearanceOptions } : { } ) ,
484500 } ,
485501 localization : l [ initialLocale as keyof typeof l ] ,
0 commit comments