首页 > 解决方案 > 无法解析 CSS

问题描述

我正在学习 NativeScript 并遵循此处的指南https://docs.nativescript.org/angular/ui/styling。但我似乎无法让特定于平台的 CSS 工作,我收到错误“错误:无法解析 app.component.common.css。查找:/data/data/org.nativescript.portalestapp/files/app/app。组件.common.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
}

app.component.android.css

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

.page {
    background-color: blue;
}

我完全按照指南进行操作,但我不确定我在哪里做错了。

标签: cssangularnativescriptnativescript-angular

解决方案


我改变'@import'./app.component.common.css'; @import '/app.component.common.css'; 它有效。我不知道为什么


推荐阅读