mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 18:54:11 +08:00
feat(modal): ensure header and content background color is inherit from modal
This commit is contained in:
8
core/src/components/content/content.ionic.scss
Normal file
8
core/src/components/content/content.ionic.scss
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
@import "./content.scss";
|
||||||
|
|
||||||
|
// Ionic Content
|
||||||
|
// --------------------------------------------------
|
||||||
|
|
||||||
|
:host(.in-modal) {
|
||||||
|
--background: var(--ion-bg-surface-default, var(--ion-primitives-base-white));
|
||||||
|
}
|
@ -24,8 +24,12 @@ import type { ScrollBaseDetail, ScrollDetail } from './content-interface';
|
|||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
tag: 'ion-content',
|
tag: 'ion-content',
|
||||||
styleUrl: 'content.scss',
|
|
||||||
shadow: true,
|
shadow: true,
|
||||||
|
styleUrls: {
|
||||||
|
ios: 'content.scss',
|
||||||
|
md: 'content.scss',
|
||||||
|
ionic: 'content.ionic.scss',
|
||||||
|
},
|
||||||
})
|
})
|
||||||
export class Content implements ComponentInterface {
|
export class Content implements ComponentInterface {
|
||||||
private watchDog: ReturnType<typeof setInterval> | null = null;
|
private watchDog: ReturnType<typeof setInterval> | null = null;
|
||||||
@ -458,6 +462,7 @@ export class Content implements ComponentInterface {
|
|||||||
'content-sizing': hostContext('ion-popover', this.el),
|
'content-sizing': hostContext('ion-popover', this.el),
|
||||||
overscroll: forceOverscroll,
|
overscroll: forceOverscroll,
|
||||||
[`content-${rtl}`]: true,
|
[`content-${rtl}`]: true,
|
||||||
|
'in-modal': hostContext('ion-modal', this.el),
|
||||||
})}
|
})}
|
||||||
style={{
|
style={{
|
||||||
'--offset-top': `${this.cTop}px`,
|
'--offset-top': `${this.cTop}px`,
|
||||||
|
@ -11,6 +11,10 @@ ion-header {
|
|||||||
&.header-divider {
|
&.header-divider {
|
||||||
border-bottom: globals.$ion-border-size-025 globals.$ion-border-style-solid globals.$ion-primitives-neutral-300;
|
border-bottom: globals.$ion-border-size-025 globals.$ion-border-style-solid globals.$ion-primitives-neutral-300;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.in-modal {
|
||||||
|
--background: var(--ion-bg-surface-default, var(--ion-primitives-base-white));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ion-toolbar + ion-toolbar {
|
ion-toolbar + ion-toolbar {
|
||||||
|
@ -236,6 +236,7 @@ export class Header implements ComponentInterface {
|
|||||||
[`header-collapse-${collapse}`]: true,
|
[`header-collapse-${collapse}`]: true,
|
||||||
[`header-translucent-${theme}`]: this.translucent,
|
[`header-translucent-${theme}`]: this.translucent,
|
||||||
['header-divider']: divider,
|
['header-divider']: divider,
|
||||||
|
'in-modal': hostContext('ion-modal', this.el),
|
||||||
}}
|
}}
|
||||||
{...inheritedAttributes}
|
{...inheritedAttributes}
|
||||||
>
|
>
|
||||||
|
Reference in New Issue
Block a user