mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
fix(Application): orientation & systemAppearance root classes
This commit is contained in:
@ -233,6 +233,8 @@ export class ApplicationCommon {
|
|||||||
private setRootViewCSSClasses(rootView: View): void {
|
private setRootViewCSSClasses(rootView: View): void {
|
||||||
const platform = Device.os.toLowerCase();
|
const platform = Device.os.toLowerCase();
|
||||||
const deviceType = Device.deviceType.toLowerCase();
|
const deviceType = Device.deviceType.toLowerCase();
|
||||||
|
const orientation = this.orientation();
|
||||||
|
const systemAppearance = this.systemAppearance();
|
||||||
|
|
||||||
if (platform) {
|
if (platform) {
|
||||||
CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${platform}`);
|
CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${platform}`);
|
||||||
@ -242,12 +244,12 @@ export class ApplicationCommon {
|
|||||||
CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${deviceType}`);
|
CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${deviceType}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.orientation) {
|
if (orientation) {
|
||||||
CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${this.orientation}`);
|
CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${orientation}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.systemAppearance) {
|
if (systemAppearance) {
|
||||||
CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${this.systemAppearance}`);
|
CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${systemAppearance}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
rootView.cssClasses.add(CSSUtils.ROOT_VIEW_CSS_CLASS);
|
rootView.cssClasses.add(CSSUtils.ROOT_VIEW_CSS_CLASS);
|
||||||
|
Reference in New Issue
Block a user