File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ declare const __ANDROID__: boolean;
135
135
declare const __IOS__ : boolean ;
136
136
declare const __VISIONOS__ : boolean ;
137
137
declare const __ACCESSIBILITY_DEFAULT_ENABLED__ : boolean ;
138
+ declare const __ONLY_ALLOW_ROOT_VARIABLES__ : boolean ;
138
139
139
140
declare function setTimeout ( callback : ( ...args : any [ ] ) => void , ms : number , ...args : any [ ] ) : number ;
140
141
declare function clearTimeout ( timeoutId : number ) : void ;
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import { ViewBase } from '../view-base';
4
4
import { PropertyChangeData , WrappedValue } from '../../../data/observable' ;
5
5
import { Trace } from '../../../trace' ;
6
6
7
+ import { Application } from '../../../application' ;
8
+
7
9
import { Style } from '../../styling/style' ;
8
10
9
11
import { profile } from '../../../profiling' ;
@@ -130,7 +132,12 @@ export function _evaluateCssVariableExpression(view: ViewBase, cssName: string,
130
132
. map ( ( v ) => v . trim ( ) )
131
133
. filter ( ( v ) => ! ! v ) ;
132
134
const cssVariableName = matched . shift ( ) ;
133
- let cssVariableValue = view . style . getCssVariable ( cssVariableName ) ;
135
+ let cssVariableValue ;
136
+ if ( typeof __ONLY_ALLOW_ROOT_VARIABLES__ !== 'undefined' && __ONLY_ALLOW_ROOT_VARIABLES__ === true ) {
137
+ cssVariableValue = Application . getRootView ( ) . style . getCssVariable ( cssVariableName ) ;
138
+ } else {
139
+ cssVariableValue = view . style . getCssVariable ( cssVariableName ) ;
140
+ }
134
141
if ( cssVariableValue === null && matched . length ) {
135
142
cssVariableValue = _evaluateCssVariableExpression ( view , cssName , matched . join ( ', ' ) ) . split ( ',' ) [ 0 ] ;
136
143
}
You can’t perform that action at this time.
0 commit comments