css - 无法解析 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;
}
我完全按照指南进行操作,但我不确定我在哪里做错了。
解决方案
我改变'@import'./app.component.common.css'; @import '/app.component.common.css'; 它有效。我不知道为什么
推荐阅读
- python - Flask-SQLAlchemy 摆脱 `idle in transaction`
- regex - 正则表达式:删除带有行继续字符的多个结尾
- php - 错误:在属性路径“provincie_id”处给出的“int”、“App\Entity\Provincie”类型的预期参数
- azure - 在 Azure 中,如何正确抑制电子邮件警报?
- java - 如何使用可以使用方法的 ArrayList 创建动态对象?
- r - ui 和服务器脚本作为一个脚本运行,运行良好。但是在不同的文件 ui.R 和 server.R 中运行脚本会引发错误
- c# - 是否可以使用 Windows 应用程序打包项目打包两个 UWP 应用程序?
- c# - 如何在 ASP.NET Core 中修复基于策略的授权
- javascript - 如何在数据库中存储 JavaScript 变量
- c# - 如何调用需要复杂类型作为参数之一的存储 SQL 过程?