Skip to content

Commit ffac10e

Browse files
authored
type selector style for body bg color
background color doesn't work in outlook for body
1 parent 8dfb96a commit ffac10e

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

packages/body/src/body.tsx

+14-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,20 @@ export type BodyProps = Readonly<React.HtmlHTMLAttributes<HTMLBodyElement>>;
55
export const Body = React.forwardRef<HTMLBodyElement, BodyProps>(
66
({ children, style, ...props }, ref) => {
77
return (
8-
<body {...props} ref={ref} style={style}>
9-
{children}
10-
</body>
8+
<>
9+
{style?.backgroundColor && (
10+
<style>
11+
{`
12+
body {
13+
background-color: ${style.backgroundColor}
14+
}
15+
`}
16+
</style>
17+
)}
18+
<body {...props} ref={ref} style={style}>
19+
{children}
20+
</body>
21+
</>
1122
);
1223
},
1324
);

0 commit comments

Comments
 (0)