最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - override :host css in ionic framework - Stack Overflow

programmeradmin4浏览0评论

how can i override :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. this css is on ion-content

I'd appreciate any help.

how can i override :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. this css is on ion-content

I'd appreciate any help.

Share Improve this question asked Jul 21, 2021 at 20:56 Mukash WastiMukash Wasti 1512 silver badges17 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

You don't have to change the :host CSS to change the background of ion-content. You can add this to your CSS

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

But if you really want to change :host CSS, then you can add this in your global CSS file.

:host {
    --background: none; // or whatever color you want
}
发布评论

评论列表(0)

  1. 暂无评论