@@ -189,8 +189,23 @@ export function flattenPageBackground(
189189 if ( pageBackground . background_color )
190190 result [ "--ul-theme-page-bg-background-color" ] =
191191 pageBackground . background_color ;
192- if ( pageBackground . page_layout )
192+ if ( pageBackground . background_image_url ) {
193+ result [ "--ul-theme-page-bg-background-image-url" ] =
194+ pageBackground . background_image_url === null || pageBackground . background_image_url === ""
195+ ? "none"
196+ : `url("${ pageBackground . background_image_url } ")` ;
197+ }
198+ if ( pageBackground . page_layout ) {
193199 result [ "--ul-theme-page-bg-page-layout" ] = pageBackground . page_layout ;
200+
201+ // Convert to CSS justify-content values for use with arbitrary properties
202+ const layoutMap : Record < string , string > = {
203+ "center" : "center" ,
204+ "left" : "flex-start" ,
205+ "right" : "flex-end"
206+ } ;
207+ result [ "--justify-page-layout" ] = layoutMap [ pageBackground . page_layout ] || "center" ;
208+ }
194209
195210 return result ;
196211}
@@ -201,18 +216,41 @@ export function flattenPageBackground(
201216export function flattenWidget ( widget : any ) : Record < string , string > {
202217 const result : Record < string , string > = { } ;
203218
204- if ( widget . logo_position )
219+ // Logo position: convert Auth0 values to Tailwind justify values
220+ if ( widget . logo_position ) {
205221 result [ "--ul-theme-widget-logo-position" ] = widget . logo_position ;
222+
223+ // Convert to Tailwind semantic variable
224+ const positionMap : Record < string , string > = {
225+ center : "center" ,
226+ left : "flex-start" ,
227+ right : "flex-end" ,
228+ none : "none" ,
229+ } ;
230+ result [ "--justify-widget-logo" ] =
231+ positionMap [ widget . logo_position ] || "center" ;
232+ }
206233 if ( widget . logo_url )
207234 result [ "--ul-theme-widget-logo-url" ] = `"${ widget . logo_url } "` ;
208235
209236 // Logo height needs px units
210237 if ( widget . logo_height )
211238 result [ "--ul-theme-widget-logo-height" ] = `${ widget . logo_height } px` ;
212239
213- if ( widget . header_text_alignment )
240+ // Header text alignment: convert Auth0 values to CSS text-align values
241+ if ( widget . header_text_alignment ) {
214242 result [ "--ul-theme-widget-header-text-alignment" ] =
215243 widget . header_text_alignment ;
244+
245+ // Convert to CSS text-align values for use with arbitrary properties
246+ const alignmentMap : Record < string , string > = {
247+ center : "center" ,
248+ left : "left" ,
249+ right : "right" ,
250+ } ;
251+ result [ "--text-align-header" ] =
252+ alignmentMap [ widget . header_text_alignment ] || "center" ;
253+ }
216254 if ( widget . social_buttons_layout )
217255 result [ "--ul-theme-widget-social-buttons-layout" ] =
218256 widget . social_buttons_layout ;
0 commit comments