Gab*_*oni 1 sass ionic-framework ionic4
在ionic 3中我们使用app.scss文件来编写全局样式。Ionic 4不提供 scss 变量来覆盖ion-inputs背景以及许多其他 css 属性。
我需要将白色背景应用于所有ion-inputs. 目前,我可以通过在每个组件上复制以下 scss 代码来完成此操作:
:host {
ion-input {
--background: white;
}
}
Run Code Online (Sandbox Code Playgroud)
但我只想把这段代码写在一个地方。scss 文件是做什么的?我必须将该文件导入到某个地方吗?
你只需要把你的CSS像这样放在variable.scss中
ion-input {
background-color: white;
}
Run Code Online (Sandbox Code Playgroud)
那么每当您使用它时ion-input,它都会采用背景色白色。
| 归档时间: |
|
| 查看次数: |
5421 次 |
| 最近记录: |