Nativescript CSS-错误:require的第一个参数应该是字符串

时间:2019-11-04 05:04:20

标签: css angular nativescript nativescript-angular

尝试为我的应用程序组件创建平台特定的CSS时出现以下错误。我的android.css工作正常,但common.css无效。有什么想法吗?

JS: Error: /app.component.common.css does not start with /data/data/org.nativescript.portalestapp/files/app

JS: Error: Could not load CSS from /app.component.common.css: Error: require's first parameter should be string

我有以下文件: app.component.html

app.component.ts

app.component.common.css

app.component.android.css

app.component.ios.css

app.component.ts:

@Component({
    selector: "ns-app",
    moduleId: module.id,
    templateUrl: "app.component.html",
    styleUrls: ["./app.component.css"]
})

app.component.common.css:

.page{
    background-color: #F4F5F7;
    font-family:Poppins-Regular, Poppins
}

.custom-action-bar {
    background-color:transparent;
}

app.component.android.css:

@import "/app.component.common.css";

.page {
    background-color: #fffffffa;
}

1 个答案:

答案 0 :(得分:0)

page{
    background-color: #F4F5F7;
    font-family:Poppins-Regular, Poppins
}

custom-action-bar {
    background-color:transparent;
}

您的第一项必须是字符串