feat(content): add parts support for background, scroll (#20929)

This commit is contained in:
Liam DeBeasi
2020-04-27 16:01:39 -04:00
committed by GitHub
parent 64144960b0
commit 578ab93d29
4 changed files with 21 additions and 3 deletions

View File

@ -9,6 +9,9 @@ import { createColorClasses, hostContext } from '../../utils/theme';
/**
* @slot - Content is placed in the scrollable area if provided without a slot.
* @slot fixed - Should be used for fixed content that should not scroll.
*
* @part background - The background of the content.
* @part scroll - The scrollable container of the content.
*/
@Component({
tag: 'ion-content',
@ -321,7 +324,7 @@ export class Content implements ComponentInterface {
'--offset-bottom': `${this.cBottom}px`,
}}
>
<div id="background-content"></div>
<div id="background-content" part="background"></div>
<main
class={{
'inner-scroll': true,
@ -331,6 +334,7 @@ export class Content implements ComponentInterface {
}}
ref={el => this.scrollEl = el!}
onScroll={(this.scrollEvents) ? ev => this.onScroll(ev) : undefined}
part="scroll"
>
<slot></slot>
</main>