Skip to content

Commit 2cc0a5f

Browse files
authored
fix(block): improve content layout (#5473)
#5422
1 parent 3898927 commit 2cc0a5f

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

src/components/block/block.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,12 @@ calcite-handle {
129129
@apply text-color-1;
130130
}
131131

132+
.container {
133+
@apply flex flex-col h-full;
134+
}
135+
132136
.content {
133-
@apply animate-in
134-
relative;
137+
@apply animate-in flex-1 relative;
135138
}
136139

137140
.content--spaced {

src/components/block/block.stories.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,8 @@ export const darkThemeRTL_TestOnly = (): string =>
202202
</calcite-block-section>
203203
`
204204
);
205+
206+
export const contentCanTakeFullHeight_TestOnly = (): string =>
207+
html`<calcite-block open heading="Heading" summary="summary" style="height: 250px">
208+
<div style="background: red; height: 100%;">should take full width of the content area</div>
209+
</calcite-block>`;

src/components/block/block.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export class Block implements ConditionalSlotComponent, InteractiveComponent {
290290
<article
291291
aria-busy={toAriaBoolean(loading)}
292292
class={{
293-
[CSS.article]: true
293+
[CSS.container]: true
294294
}}
295295
>
296296
{headerNode}

src/components/block/resources.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const CSS = {
2-
article: "article",
2+
container: "container",
33
content: "content",
44
contentSpaced: "content--spaced",
55
headerContainer: "header-container",

0 commit comments

Comments
 (0)