Skip to content

Commit 49ab74a

Browse files
committed
Stack - Added height and instruction for building sidebars
1 parent 88ea32c commit 49ab74a

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
:host {
22
display: flex;
33
flex-direction: column;
4-
padding: 12px;
54
}
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Component, HostBinding, Input } from '@angular/core';
2-
import { Properties } from 'csstype';
32
import { AlignItems, Gap, JustifyContent, Padding } from '../common';
43

54
@Component({
@@ -10,15 +9,20 @@ import { AlignItems, Gap, JustifyContent, Padding } from '../common';
109
styleUrl: './stack.component.css',
1110
})
1211
export class StackComponent {
13-
@HostBinding('style.justify-content') @Input() justifyContent: JustifyContent =
14-
'flex-start';
12+
@HostBinding('style.justify-content')
13+
@Input()
14+
justifyContent: JustifyContent = 'flex-start';
1515
@HostBinding('style.align-items')
1616
@Input()
1717
alignItems: AlignItems = 'stretch';
18+
@HostBinding('style.height')
19+
@Input()
20+
height?: string;
1821
@HostBinding('style.gap')
1922
/**
2023
* The gap between the children of the stack.
2124
*/
22-
@Input() gap: Gap = '0';
25+
@Input()
26+
gap: Gap = '0';
2327
@HostBinding('style.padding') @Input() padding: Padding = '0';
2428
}

projects/layout-components/src/stories/stack.stories.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { StackComponent } from '../lib/stack/stack.component';
99

1010
/**
1111
* The Stack component is used to arrange its children vertically.
12+
*
13+
* If you want to create a sidebar, Stack is the most suitable component. Set <code>[height]="100%"</code> on Stack and do the same with all its parents. If you want a child of the Stack to grow to cover a specific portion of the available space, set a <code>flex-grow</code> on it.
1214
*/
1315
const meta: Meta<typeof StackComponent> = {
1416
title: 'Components/Stack',
@@ -35,5 +37,6 @@ type Story = StoryObj<StackComponent>;
3537
export const Basic: Story = {
3638
args: {
3739
gap: '16px',
40+
height: '100%',
3841
},
3942
};

0 commit comments

Comments
 (0)