Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(shell-panel): adds border at the start when slotted in panel-end #8314

Merged
merged 9 commits into from
Dec 7, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,22 @@ slot[name="action-bar"]::slotted(calcite-action-bar),
@apply border-color-3 border border-solid;
}

:host([position="start"]) slot[name="action-bar"]::slotted(calcite-action-bar),
:host([position="start"]) .content ::slotted(calcite-flow),
:host([position="start"]) .content ::slotted(calcite-panel) {
border-inline-start: none;
:host([position="start"]:not([slot="panel-end"])),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clean up the duplicate selectors?

Copy link
Contributor Author

@anveshmekala anveshmekala Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these aren't duplicate selectors. The reason having them is to accommodate any existing code which do not specify slot for the shell-panel .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm.

:host([position="end"][slot="panel-start"]) {
slot[name="action-bar"]::slotted(calcite-action-bar),
.content ::slotted(calcite-flow),
.content ::slotted(calcite-panel) {
border-inline-start: none;
}
}

:host([position="end"]) slot[name="action-bar"]::slotted(calcite-action-bar),
:host([position="end"]) .content ::slotted(calcite-flow),
:host([position="end"]) .content ::slotted(calcite-panel) {
border-inline-end: none;
:host([position="end"]:not([slot="panel-start"])),
:host([position="start"][slot="panel-end"]) {
slot[name="action-bar"]::slotted(calcite-action-bar),
.content ::slotted(calcite-flow),
.content ::slotted(calcite-panel) {
border-inline-end: none;
}
}

:host([layout="horizontal"]) slot[name="action-bar"]::slotted(calcite-action-bar) {
Expand Down
26 changes: 26 additions & 0 deletions packages/calcite-components/src/components/shell/shell.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1323,3 +1323,29 @@ position:relative;
overlayDisplayMode_TestOnly.parameters = {
chromatic: { delay: 500 },
};

export const panelEndWithPositionStart_TestOnly = (): string => html`<calcite-shell>
<calcite-shell-panel slot="panel-end" width-scale="l" position="start" display-mode="block" resizable>
<calcite-action-bar slot="action-bar">
<calcite-action text="Save" icon="save" indicator></calcite-action>
<calcite-action active icon="map" text="Map"></calcite-action>
<calcite-action icon="layer" text="Layer"></calcite-action>
</calcite-action-bar>
<calcite-panel heading="Map Options">
<calcite-button width="half" slot="footer"> Next </calcite-button>
<calcite-block collapsible heading="Layer effects" description="Adjust blur, highlight, and more">
<calcite-icon scale="s" slot="icon" icon="effects"></calcite-icon>
<calcite-notice open>
<div slot="message">Use layer effects sparingly, for emphasis</div>
</calcite-notice>
</calcite-block>
<calcite-block collapsible heading="Symbology" description="Select type, color, and transparency">
<calcite-icon scale="s" slot="icon" icon="map-pin"></calcite-icon>
<calcite-notice open>
<div slot="message">The viewers are going to love this</div>
</calcite-notice>
</calcite-block>
<calcite-fab slot="fab"></calcite-fab>
</calcite-panel>
</calcite-shell-panel>
</calcite-shell>`;
Loading