Skip to content

Commit 421c6d4

Browse files
committed
Add body margin reset
1 parent e10e882 commit 421c6d4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/theme-provider/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const BodyStyles = () =>
1616
boxSizing,
1717
},
1818
body: {
19+
margin: 0,
1920
variant: 'styles.root',
2021
},
2122
})(theme)

packages/theme-provider/test/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ test('renders global styles', () => {
134134
expect(style.lineHeight).toBe('1.5')
135135
})
136136

137+
test('resets body margin', () => {
138+
const root = render(
139+
<ThemeProvider>
140+
<h1>Hello</h1>
141+
</ThemeProvider>
142+
)
143+
const style = window.getComputedStyle(root.baseElement)
144+
expect(style.margin).toBe('0px')
145+
})
146+
137147
test('does not render invalid global styles', () => {
138148
const root = render(
139149
<ThemeProvider theme={{}}>

0 commit comments

Comments
 (0)