Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/grumpy-bats-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': minor
---

Add flex-direction: column-reverse to AlphaStack
7 changes: 2 additions & 5 deletions polaris-react/src/components/AlphaStack/AlphaStack.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
--pc-stack-gap-xl: var(--pc-stack-gap-lg);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
display: flex;
flex-direction: column;
// stylelint-disable-next-line -- local component custom property is required for flex direction
flex-direction: var(--pc-stack-order);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
align-items: var(--pc-stack-align);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
Expand All @@ -38,10 +39,6 @@
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
gap: var(--pc-stack-gap-xl);
}

> * {
max-width: 100%;
}
}

.listReset {
Expand Down
4 changes: 4 additions & 0 deletions polaris-react/src/components/AlphaStack/AlphaStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export interface AlphaStackProps extends React.AriaAttributes {
gap?: Gap;
/** HTML id attribute */
id?: string;
/** Toggle order of child items */
reverseOrder?: boolean;
}

export const AlphaStack = ({
Expand All @@ -45,6 +47,7 @@ export const AlphaStack = ({
fullWidth = false,
gap = '4',
id,
reverseOrder = false,
...restProps
}: AlphaStackProps) => {
const className = classNames(
Expand All @@ -55,6 +58,7 @@ export const AlphaStack = ({

const style = {
'--pc-stack-align': align ? `${align}` : '',
'--pc-stack-order': reverseOrder ? 'column-reverse' : 'column',
...getResponsiveProps('stack', 'gap', 'space', gap),
} as React.CSSProperties;

Expand Down