基于 ionic platform.height 的条件 SCSS

Conditional SCSS based on ionic platform.height

有没有办法让scss代码响应平台高度?

在 ionic 中,我得到的平台高度如下:

this.platform.height()

我的 app.core.scss 文件中有一个 class,如果平台高度 >480,我想将 max-width 设置为 100%,如果平台高度 <=480

@Bill:首先尝试媒体查询。但是平台高度是什么意思?这是设备屏幕高度吗?

@media screen and (max-height: 480px){
    .CLASS-TO-BE-SET {
        width: 50%;
    }
}

@media screen and (min-height: 481px){
    .CLASS-TO-BE-SET {
        width: 100%;
    }
}