如何使用 CSS 更改 Ionic 4 中的工具栏颜色

How to change the toolbar color in Ionic 4 with CSS

我想通过 page.scss ion-toolbar, ion-tab-bar 和 ion-tab-button 改变背景颜色。

它适用于 ion-tab-bar 和 ion-tab-button 但不适用于 ion-toolbar。

有代码来自 page.scss:

ion-toolbar, ion-tab-bar, ion-tab-button {

    background-color: aquamarine;

}

感谢您的帮助

他们在 Ionic 4 中使用 CSS 变量,尝试类似

ion-toolbar {
    --background: aquamarine;
    }

您可以在此处详细了解工具栏和其他组件的变量: https://ionicframework.com/docs/api/toolbar