Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.
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/hip-maps-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': minor
---

Added support for `outline` to `Box`
3 changes: 3 additions & 0 deletions polaris-react/src/components/Box/Box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
--pc-box-min-height: initial;
--pc-box-min-width: initial;
--pc-box-max-width: initial;
--pc-box-outline: initial;
--pc-box-overflow-x: initial;
--pc-box-overflow-y: initial;
--pc-box-width: initial;
Expand Down Expand Up @@ -126,6 +127,8 @@
min-width: var(--pc-box-min-width);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
max-width: var(--pc-box-max-width);
// stylelint-disable-next-line -- component custom property that maps to Polaris tokens
outline: var(--pc-box-outline);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
overflow-x: var(--pc-box-overflow-x);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
Expand Down
4 changes: 4 additions & 0 deletions polaris-react/src/components/Box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ export interface BoxProps extends React.AriaAttributes {
insetInlineEnd?: Spacing;
/** Opacity of box */
opacity?: string;
/** Outline style */
outline?: BorderTokenAlias;
/** Visually hide the contents during print */
printHidden?: boolean;
/** Visually hide the contents (still announced by screenreader) */
Expand Down Expand Up @@ -211,6 +213,7 @@ export const Box = forwardRef<HTMLElement, BoxProps>(
maxWidth,
overflowX,
overflowY,
outline,
padding,
paddingBlockStart,
paddingBlockEnd,
Expand Down Expand Up @@ -282,6 +285,7 @@ export const Box = forwardRef<HTMLElement, BoxProps>(
'--pc-box-min-height': minHeight,
'--pc-box-min-width': minWidth,
'--pc-box-max-width': maxWidth,
'--pc-box-outline': outline ? `var(--p-border-${outline})` : undefined,
'--pc-box-overflow-x': overflowX,
'--pc-box-overflow-y': overflowY,
...getResponsiveProps(
Expand Down
Loading