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
26 changes: 26 additions & 0 deletions pages/container/style-custom.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,32 @@ export default function CustomContainer() {
>
Container content
</Container>

<Container
header={
<>
<Box color="inherit">{`<Box color="inherit" />`}</Box> Plain text
</>
}
footer={
<>
<Box color="inherit">{`<Box color="inherit" />`}</Box> Plain text
</>
}
style={{
root: {
background: 'light-dark(#1a1f6e, #bbc2f4)',
color: 'light-dark(#ffffff, #000000)',
},
content: {
paddingBlock: '12px',
},
}}
>
<>
<Box color="inherit">{`<Box color="inherit" />`}</Box> Plain text
</>
</Container>
</SpaceBetween>
</ScreenshotArea>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9722,12 +9722,17 @@ Refer to the [style](/components/container/?tabId=style) tab for more details.",
"optional": true,
"type": "string",
},
{
"name": "color",
"optional": true,
"type": "string",
},
],
"type": "object",
},
"name": "root",
"optional": true,
"type": "{ background?: string | undefined; borderColor?: string | undefined; borderRadius?: string | undefined; borderWidth?: string | undefined; boxShadow?: string | undefined; }",
"type": "{ background?: string | undefined; borderColor?: string | undefined; borderRadius?: string | undefined; borderWidth?: string | undefined; boxShadow?: string | undefined; color?: string | undefined; }",
},
],
"type": "object",
Expand Down Expand Up @@ -27202,12 +27207,17 @@ Refer to the [style](/components/tabs/?tabId=style) tab for more details.",
"optional": true,
"type": "string",
},
{
"name": "color",
"optional": true,
"type": "string",
},
],
"type": "object",
},
"name": "root",
"optional": true,
"type": "{ background?: string | undefined; borderColor?: string | undefined; borderRadius?: string | undefined; borderWidth?: string | undefined; boxShadow?: string | undefined; }",
"type": "{ background?: string | undefined; borderColor?: string | undefined; borderRadius?: string | undefined; borderWidth?: string | undefined; boxShadow?: string | undefined; color?: string | undefined; }",
},
],
"type": "object",
Expand Down
3 changes: 3 additions & 0 deletions src/container/__tests__/__snapshots__/styles.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ exports[`getRootStyles handles all possible style configurations 1`] = `
"borderRadius": undefined,
"borderWidth": undefined,
"boxShadow": undefined,
"color": undefined,
}
`;

Expand All @@ -138,6 +139,7 @@ exports[`getRootStyles handles all possible style configurations 2`] = `
"borderRadius": undefined,
"borderWidth": undefined,
"boxShadow": undefined,
"color": undefined,
}
`;

Expand All @@ -148,5 +150,6 @@ exports[`getRootStyles handles all possible style configurations 3`] = `
"borderRadius": "8px",
"borderWidth": "1px",
"boxShadow": "0 1px 3px rgba(0,0,0,0.1)",
"color": "#000000",
}
`;
1 change: 1 addition & 0 deletions src/container/__tests__/styles.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const allStyles = {
borderRadius: '8px',
borderWidth: '1px',
boxShadow: '0 1px 3px rgba(0,0,0,0.1)',
color: '#000000',
},
content: {
paddingBlock: '16px',
Expand Down
1 change: 1 addition & 0 deletions src/container/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export namespace ContainerProps {
borderRadius?: string;
borderWidth?: string;
boxShadow?: string;
color?: string;
};
content?: {
paddingBlock?: string;
Expand Down
1 change: 1 addition & 0 deletions src/container/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function getRootStyles(style: ContainerProps.Style | undefined) {
borderRadius: style?.root?.borderRadius,
borderWidth: style?.root?.borderWidth,
boxShadow: style?.root?.boxShadow,
color: style?.root?.color,
};
}

Expand Down
Loading