File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -469,6 +469,7 @@ const transformToNativeCSS = (cssText) => {
469469 }
470470
471471 let hasIfConditions = false ;
472+ const nonIfProperties = [ ] ;
472473
473474 for ( const { property, value } of rule . properties ) {
474475 if ( value . includes ( 'if(' ) ) {
@@ -487,10 +488,17 @@ const transformToNativeCSS = (cssText) => {
487488 runtimeCSS += transformed . runtimeCSS + '\n' ;
488489 hasRuntimeRules = true ;
489490 }
491+ } else {
492+ // Collect non-if() properties to preserve them
493+ nonIfProperties . push ( `${ property } : ${ value } ` ) ;
490494 }
491495 }
492496
493- if ( ! hasIfConditions ) {
497+ // If we have non-if() properties in a rule that also has if() properties,
498+ // we need to create a base rule with those properties
499+ if ( hasIfConditions && nonIfProperties . length > 0 ) {
500+ nativeCSS += `${ rule . selector } { ${ nonIfProperties . join ( '; ' ) } ; }\n` ;
501+ } else if ( ! hasIfConditions ) {
494502 // Keep rules without if() conditions as-is
495503 nativeCSS += ruleText + '\n' ;
496504 }
You can’t perform that action at this time.
0 commit comments