File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ import i18n, { baseLocales } from "./i18next"
7
7
8
8
const extendedTheme = extendBaseTheme ( theme )
9
9
10
- export const chakraBreakpointArray = Object . entries ( extendedTheme . breakpoints )
10
+ export const chakraBreakpointArray = Object . entries (
11
+ extendedTheme . breakpoints
12
+ ) as [ string , string ] [ ]
11
13
12
14
const preview : Preview = {
13
15
globals : {
@@ -35,6 +37,9 @@ const preview: Preview = {
35
37
viewports : chakraBreakpointArray . reduce ( ( prevVal , currVal ) => {
36
38
const [ token , key ] = currVal
37
39
40
+ // `key` value is in em. Need to convert to px for Chromatic Story mode snapshots
41
+ const emToPx = ( Number ( key . replace ( "em" , "" ) ) * 16 ) . toString ( ) + "px"
42
+
38
43
// Replace base value
39
44
if ( token === "base" )
40
45
return {
@@ -53,7 +58,7 @@ const preview: Preview = {
53
58
[ token ] : {
54
59
name : token ,
55
60
styles : {
56
- width : key ,
61
+ width : emToPx ,
57
62
height : "600px" ,
58
63
} ,
59
64
} ,
You can’t perform that action at this time.
0 commit comments