Skip to content

Commit ac4ea32

Browse files
authored
feat(toolbar): add shadow parts for background, container, and content (#30069)
Resolves #30068 --------- Add `part` attributes to toolbar for the `background`, `container` and `content`.
1 parent efd3e0f commit ac4ea32

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

core/api.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -2000,4 +2000,7 @@ ion-toolbar,css-prop,--padding-end,md
20002000
ion-toolbar,css-prop,--padding-start,ios
20012001
ion-toolbar,css-prop,--padding-start,md
20022002
ion-toolbar,css-prop,--padding-top,ios
2003-
ion-toolbar,css-prop,--padding-top,md
2003+
ion-toolbar,css-prop,--padding-top,md
2004+
ion-toolbar,part,background
2005+
ion-toolbar,part,container
2006+
ion-toolbar,part,content

core/src/components/toolbar/toolbar.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import type { Color, CssClassMap, StyleEventDetail } from '../../interface';
1313
* @slot secondary - Content is placed to the left of the toolbar text in `ios` mode, and directly to the right in `md` mode.
1414
* @slot primary - Content is placed to the right of the toolbar text in `ios` mode, and to the far right in `md` mode.
1515
* @slot end - Content is placed to the right of the toolbar text in LTR, and to the left in RTL.
16+
*
17+
* @part background - The background of the toolbar, covering the entire area behind the toolbar content.
18+
* @part container - The container that wraps all toolbar content, including the default slot and named slot content.
19+
* @part content - The container for the default slot, wrapping content provided without a named slot.
1620
*/
1721
@Component({
1822
tag: 'ion-toolbar',
@@ -97,11 +101,11 @@ export class Toolbar implements ComponentInterface {
97101
}),
98102
}}
99103
>
100-
<div class="toolbar-background"></div>
101-
<div class="toolbar-container">
104+
<div class="toolbar-background" part="background"></div>
105+
<div class="toolbar-container" part="container">
102106
<slot name="start"></slot>
103107
<slot name="secondary"></slot>
104-
<div class="toolbar-content">
108+
<div class="toolbar-content" part="content">
105109
<slot></slot>
106110
</div>
107111
<slot name="primary"></slot>

0 commit comments

Comments
 (0)