【问题标题】:override :host css in ionic framework覆盖:离子框架中的主机 css
【发布时间】:2021-07-21 20:56:49
【问题描述】:

我如何覆盖 :host css

:host {
--width: 304px;
--min-width: auto;
--max-width: auto;
--height: 100%;
--min-height: auto;
--max-height: auto;
--background: var(--ion-background-color, #fff); // <-- i want to shut this down
inset: 0px;
display: none;
position: absolute;
contain: strict;

}

PS。这个 css 在 ion-content 上

我将不胜感激。

【问题讨论】:

    标签: javascript angular ionic-framework


    【解决方案1】:

    您无需更改:host CSS 即可更改ion-content 的背景。您可以将其添加到您的 CSS 中

    ion-content{
        --ion-background-color:#111D12; // Or whatever color you want
    }
    

    但如果你真的想改变:host CSS,那么你可以在你的全局 CSS 文件中添加它。

    :host {
        --background: none; // or whatever color you want
    }
    

    【讨论】:

    猜你喜欢
    • 2022-09-23
    • 1970-01-01
    • 1970-01-01
    • 2019-05-17
    • 2017-10-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-28
    相关资源
    最近更新 更多