@@ -142,6 +142,14 @@ function removeCssClass(rootView: View, cssClass: string) {
142142 rootView . cssClasses . delete ( cssClass ) ;
143143}
144144
145+ function increaseStyleScopeApplicationCssSelectorVersion ( rootView : View ) {
146+ const styleScope = rootView . _styleScope || ( ( < any > rootView ) . currentPage && ( < any > rootView ) . currentPage . _styleScope ) ;
147+
148+ if ( styleScope ) {
149+ styleScope . _increaseApplicationCssSelectorVersion ( ) ;
150+ }
151+ }
152+
145153export function orientationChanged ( rootView : View , newOrientation : "portrait" | "landscape" | "unknown" ) : void {
146154 if ( ! rootView ) {
147155 return ;
@@ -151,6 +159,7 @@ export function orientationChanged(rootView: View, newOrientation: "portrait" |
151159 if ( ! rootView . cssClasses . has ( newOrientationCssClass ) ) {
152160 ORIENTATION_CSS_CLASSES . forEach ( cssClass => removeCssClass ( rootView , cssClass ) ) ;
153161 applyCssClass ( rootView , newOrientationCssClass ) ;
162+ increaseStyleScopeApplicationCssSelectorVersion ( rootView ) ;
154163 rootView . _onCssStateChange ( ) ;
155164 }
156165}
@@ -164,6 +173,7 @@ export function systemAppearanceChanged(rootView: View, newSystemAppearance: "da
164173 if ( ! rootView . cssClasses . has ( newSystemAppearanceCssClass ) ) {
165174 SYSTEM_APPEARANCE_CSS_CLASSES . forEach ( cssClass => removeCssClass ( rootView , cssClass ) ) ;
166175 applyCssClass ( rootView , newSystemAppearanceCssClass ) ;
176+ increaseStyleScopeApplicationCssSelectorVersion ( rootView ) ;
167177 rootView . _onCssStateChange ( ) ;
168178 }
169179}
0 commit comments