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(tile): center align contentTop and contentBottom slots when alignment prop equals "center" #9732

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions packages/calcite-components/src/components/tile/tile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
z-index: var(--calcite-z-index);
}
&:focus {
box-shadow: inset 0px 0px 0px 1px var(--calcite-color-brand);
box-shadow: inset 0 0 0 1px var(--calcite-color-brand);
z-index: var(--calcite-z-index-sticky);
}
}
Expand Down Expand Up @@ -107,7 +107,9 @@
text-align: center;
}
slot[name="content-start"]::slotted(*),
slot[name="content-end"]::slotted(*) {
slot[name="content-end"]::slotted(*),
slot[name="content-top"]::slotted(*),
slot[name="content-bottom"]::slotted(*) {
align-self: center;
}
}
Expand Down Expand Up @@ -185,7 +187,7 @@
:host([selection-appearance="border"][layout="vertical"]) {
.container.selected:focus::before {
block-size: 100%;
box-shadow: inset 0px 0px 0px 1px var(--calcite-color-brand);
box-shadow: inset 0 0 0 1px var(--calcite-color-brand);
content: "";
display: block;
inline-size: 100%;
Expand All @@ -197,13 +199,13 @@

:host([selection-appearance="border"][layout="horizontal"]) {
.container.selected {
box-shadow: inset 0px -4px 0px 0px var(--calcite-color-brand);
box-shadow: inset 0 -4px 0 0 var(--calcite-color-brand);
}
}

:host([selection-appearance="border"][layout="vertical"]) {
.container.selected {
box-shadow: inset 4px 0px 0px 0px var(--calcite-color-brand);
box-shadow: inset 4px 0 0 0 var(--calcite-color-brand);
}
}

Expand Down
78 changes: 78 additions & 0 deletions packages/calcite-components/src/components/tile/tile.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,84 @@ export const allVariants = (): string => html`
</div>
</div>

<!-- content-top slot centered -->
<div class="parent">
<div class="child right-aligned-text">content-top slot centered</div>

<div class="child">
<calcite-tile
alignment="center"
description="Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collab on thinking to further the overall."
heading="Tile title lorem ipsum"
icon="layers"
scale="s"
>
<calcite-chip class="new" kind="brand" slot="content-top" scale="s">New</calcite-chip>
</calcite-tile>
</div>
<div class="child">
<calcite-tile
alignment="center"
description="Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collab on thinking to further the overall."
heading="Tile title lorem ipsum"
icon="layers"
scale="m"
>
<calcite-chip class="new" kind="brand" slot="content-top">New</calcite-chip>
</calcite-tile>
</div>
<div class="child">
<calcite-tile
alignment="center"
description="Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collab on thinking to further the overall."
heading="Tile title lorem ipsum"
icon="layers"
scale="l"
>
<calcite-chip class="new" kind="brand" slot="content-top" scale="l">New</calcite-chip>
</calcite-tile>
</div>
</div>

<!-- content-bottom slot centered-->
<div class="parent">
<div class="child right-aligned-text">content-bottom slot centered</div>

<div class="child">
<calcite-tile
alignment="center"
description="Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collab on thinking to further the overall."
heading="Tile title lorem ipsum"
icon="layers"
scale="s"
>
<calcite-chip class="new" kind="brand" slot="content-bottom" scale="s">New</calcite-chip>
</calcite-tile>
</div>
<div class="child">
<calcite-tile
alignment="center"
description="Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collab on thinking to further the overall."
heading="Tile title lorem ipsum"
icon="layers"
scale="m"
>
<calcite-chip class="new" kind="brand" slot="content-bottom">New</calcite-chip>
</calcite-tile>
</div>
<div class="child">
<calcite-tile
alignment="center"
description="Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collab on thinking to further the overall."
heading="Tile title lorem ipsum"
icon="layers"
scale="l"
>
<calcite-chip class="new" kind="brand" slot="content-bottom" scale="l">New</calcite-chip>
</calcite-tile>
</div>
</div>

<!-- link centered -->
<div class="parent">
<div class="child right-aligned-text">link centered</div>
Expand Down
78 changes: 78 additions & 0 deletions packages/calcite-components/src/demos/tile.html
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,84 @@
</div>
</div>

<!-- content-top slot centered -->
<div class="parent">
<div class="child right-aligned-text">content-top slot centered</div>

<div class="child">
<calcite-tile
alignment="center"
description="Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collab on thinking to further the overall."
heading="Tile title lorem ipsum"
icon="layers"
scale="s"
>
<calcite-chip class="new" kind="brand" slot="content-top" scale="s">New</calcite-chip>
</calcite-tile>
</div>
<div class="child">
<calcite-tile
alignment="center"
description="Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collab on thinking to further the overall."
heading="Tile title lorem ipsum"
icon="layers"
scale="m"
>
<calcite-chip class="new" kind="brand" slot="content-top">New</calcite-chip>
</calcite-tile>
</div>
<div class="child">
<calcite-tile
alignment="center"
description="Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collab on thinking to further the overall."
heading="Tile title lorem ipsum"
icon="layers"
scale="l"
>
<calcite-chip class="new" kind="brand" slot="content-top" scale="l">New</calcite-chip>
</calcite-tile>
</div>
</div>

<!-- content-bottom slot centered -->
<div class="parent">
<div class="child right-aligned-text">content-bottom slot centered</div>

<div class="child">
<calcite-tile
alignment="center"
description="Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collab on thinking to further the overall."
heading="Tile title lorem ipsum"
icon="layers"
scale="s"
>
<calcite-chip class="new" kind="brand" slot="content-bottom" scale="s">New</calcite-chip>
</calcite-tile>
</div>
<div class="child">
<calcite-tile
alignment="center"
description="Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collab on thinking to further the overall."
heading="Tile title lorem ipsum"
icon="layers"
scale="m"
>
<calcite-chip class="new" kind="brand" slot="content-bottom">New</calcite-chip>
</calcite-tile>
</div>
<div class="child">
<calcite-tile
alignment="center"
description="Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collab on thinking to further the overall."
heading="Tile title lorem ipsum"
icon="layers"
scale="l"
>
<calcite-chip class="new" kind="brand" slot="content-bottom" scale="l">New</calcite-chip>
</calcite-tile>
</div>
</div>

<!-- link centered -->
<div class="parent">
<div class="child right-aligned-text">link centered</div>
Expand Down
Loading