Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 64bddd6

Browse files
committed
fix(creset): include font-family to global styles
1 parent eb2a870 commit 64bddd6

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

packages/chakra-ui-core/src/CReset/CReset.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ const defaultConfig = theme => ({
1515
color: theme.colors.gray[800],
1616
bg: undefined,
1717
borderColor: theme.colors.gray[200],
18-
placeholderColor: theme.colors.gray[400]
18+
placeholderColor: theme.colors.gray[400],
19+
fontFamily: theme.fonts.body
1920
},
2021
dark: {
2122
color: theme.colors.whiteAlpha[900],
2223
bg: theme.colors.gray[800],
2324
borderColor: theme.colors.whiteAlpha[300],
24-
placeholderColor: theme.colors.whiteAlpha[400]
25+
placeholderColor: theme.colors.whiteAlpha[400],
26+
fontFamily: theme.fonts.body
2527
}
2628
})
2729

@@ -59,13 +61,14 @@ const CReset = {
5961
}
6062
},
6163
created () {
62-
const { color, bg, borderColor, placeholderColor } = this.styleConfig[this.colorMode]
64+
const { color, bg, borderColor, placeholderColor, fontFamily } = this.styleConfig[this.colorMode]
6365
useTailwindPreflight(this.theme)
6466
injectGlobal({
6567
html: {
6668
lineHeight: 1.5,
6769
color,
68-
backgroundColor: bg
70+
backgroundColor: bg,
71+
fontFamily
6972
},
7073

7174
'*, *::before, *::after': {

packages/chakra-ui-core/src/CReset/tests/CReset.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('CReset.vue', () => {
2929
const cssResetConfig = (_, defaults) => {
3030
const { light } = defaults
3131
return {
32-
...defaults, light: { ...light, bg: 'pink', color: 'indigo' }
32+
...defaults, light: { ...light, bg: 'pink', color: 'indigo', fontFamily: "'Comic Sans MS'" }
3333
}
3434
}
3535

packages/chakra-ui-core/src/CReset/tests/__snapshots__/CReset.test.js.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ exports[`CReset.vue should accept config prop 1`] = `
318318
data-emotion="css"
319319
>
320320
321-
html{line-height:1.5;color:#1A202C;}
321+
html{line-height:1.5;color:#1A202C;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";}
322322
</style>
323323
<style
324324
data-emotion="css"
@@ -366,7 +366,7 @@ exports[`CReset.vue should accept config prop 1`] = `
366366
data-emotion="css"
367367
>
368368
369-
html{line-height:1.5;color:indigo;background-color:pink;}
369+
html{line-height:1.5;color:indigo;background-color:pink;font-family:'Comic Sans MS';}
370370
</style>
371371
<style
372372
data-emotion="css"
@@ -731,7 +731,7 @@ exports[`CReset.vue should inject global styles 1`] = `
731731
data-emotion="css"
732732
>
733733
734-
html{line-height:1.5;color:#1A202C;}
734+
html{line-height:1.5;color:#1A202C;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";}
735735
</style>
736736
<style
737737
data-emotion="css"

0 commit comments

Comments
 (0)