离子4-背景过渡

问题描述 投票:0回答:1

如何转换离子工具栏的背景色?

问题是,在离子4中,背景颜色是由--background设置的。

这是我无法使用的.scss代码:

ion-toolbar.transparent{
    --background: red;
    transition: 1000ms linear;
}

ion-toolbar.transparent:hover{
    --background: green;
}
background ionic4 transition background-color
1个回答
0
投票

请检查以下代码,从离子工具栏中删除透明的类名称,也不要在离子工具栏中使用颜色属性

<ion-toolbar>
    <ion-title>
        Ionic Title
    </ion-title>
</ion-toolbar>

用于样式

ion-toolbar{
    --background: red;
    transition: 1000ms linear;
}

ion-toolbar:hover{
    --background: green;
}
© www.soinside.com 2019 - 2024. All rights reserved.