Skip to content

Commit

Permalink
feat(panel): improve panel header layout (#10446)
Browse files Browse the repository at this point in the history
**Related Issue:** #10385

## Summary

Slotted content will now adjust its size and position to allow more
flexible layouts, similar to how content behaves in `modal`.
  • Loading branch information
jcfranco authored Sep 30, 2024
1 parent 9729ccf commit 12f1476
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,17 @@ withTooltips.parameters = {
};

export const withCustomHeader = (): string => html`
<style>
#three-quarters-width-header-content {
width: 75%;
}
</style>
<calcite-dialog open scale="m" width-scale="s">
<div slot="${SLOTS.headerContent}">Header!</div>
<div id="three-quarters-width-header-content" slot="${SLOTS.headerContent}">
<calcite-inline-editable scale="l" editingEnabled="true">
<calcite-input alignment="start" placeholder="Enter text..." scale="l" type="text" value="Editable header" />
</calcite-inline-editable>
</div>
<p>Slotted content!</p>
</calcite-dialog>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
}

.header-content {
flex: 1 1 auto;
padding-block: var(--calcite-internal-panel-header-vertical-padding);
padding-inline: var(--calcite-internal-panel-default-padding);
}
Expand Down

0 comments on commit 12f1476

Please sign in to comment.