5

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.

1 Answer 1

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
}
Sign up to request clarification or add additional context in comments.

3 Comments

got the idea, Thanks
is the :host selector something from css? or is it custom to ionic?
Its a pseudo-class in CSS, more info developer.mozilla.org/en-US/docs/Web/CSS/:host()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.