Skip to content

Commit 65ac0ee

Browse files
committed
chore: Add color prop to container style API
1 parent a6cdcd0 commit 65ac0ee

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed

pages/container/style-custom.page.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,32 @@ export default function CustomContainer() {
208208
>
209209
Container content
210210
</Container>
211+
212+
<Container
213+
header={
214+
<>
215+
<Box color="inherit">{`<Box color="inherit" />`}</Box> Plain text
216+
</>
217+
}
218+
footer={
219+
<>
220+
<Box color="inherit">{`<Box color="inherit" />`}</Box> Plain text
221+
</>
222+
}
223+
style={{
224+
root: {
225+
background: 'light-dark(#1a1f6e, #bbc2f4)',
226+
color: 'light-dark(#ffffff, #000000)',
227+
},
228+
content: {
229+
paddingBlock: '12px',
230+
},
231+
}}
232+
>
233+
<>
234+
<Box color="inherit">{`<Box color="inherit" />`}</Box> Plain text
235+
</>
236+
</Container>
211237
</SpaceBetween>
212238
</ScreenshotArea>
213239
);

src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9722,12 +9722,17 @@ Refer to the [style](/components/container/?tabId=style) tab for more details.",
97229722
"optional": true,
97239723
"type": "string",
97249724
},
9725+
{
9726+
"name": "color",
9727+
"optional": true,
9728+
"type": "string",
9729+
},
97259730
],
97269731
"type": "object",
97279732
},
97289733
"name": "root",
97299734
"optional": true,
9730-
"type": "{ background?: string | undefined; borderColor?: string | undefined; borderRadius?: string | undefined; borderWidth?: string | undefined; boxShadow?: string | undefined; }",
9735+
"type": "{ background?: string | undefined; borderColor?: string | undefined; borderRadius?: string | undefined; borderWidth?: string | undefined; boxShadow?: string | undefined; color?: string | undefined; }",
97319736
},
97329737
],
97339738
"type": "object",
@@ -27202,12 +27207,17 @@ Refer to the [style](/components/tabs/?tabId=style) tab for more details.",
2720227207
"optional": true,
2720327208
"type": "string",
2720427209
},
27210+
{
27211+
"name": "color",
27212+
"optional": true,
27213+
"type": "string",
27214+
},
2720527215
],
2720627216
"type": "object",
2720727217
},
2720827218
"name": "root",
2720927219
"optional": true,
27210-
"type": "{ background?: string | undefined; borderColor?: string | undefined; borderRadius?: string | undefined; borderWidth?: string | undefined; boxShadow?: string | undefined; }",
27220+
"type": "{ background?: string | undefined; borderColor?: string | undefined; borderRadius?: string | undefined; borderWidth?: string | undefined; boxShadow?: string | undefined; color?: string | undefined; }",
2721127221
},
2721227222
],
2721327223
"type": "object",

src/container/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export namespace ContainerProps {
131131
borderRadius?: string;
132132
borderWidth?: string;
133133
boxShadow?: string;
134+
color?: string;
134135
};
135136
content?: {
136137
paddingBlock?: string;

src/container/style.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export function getRootStyles(style: ContainerProps.Style | undefined) {
1414
borderRadius: style?.root?.borderRadius,
1515
borderWidth: style?.root?.borderWidth,
1616
boxShadow: style?.root?.boxShadow,
17+
color: style?.root?.color,
1718
};
1819
}
1920

0 commit comments

Comments
 (0)