Skip to content

Commit 4fa587a

Browse files
committed
Update benchmarks to use unitless values
1 parent 0d56ca9 commit 4fa587a

File tree

9 files changed

+92
-92
lines changed

9 files changed

+92
-92
lines changed

benchmarks/src/implementations/use-classes-published/Box.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,34 @@ import { useClasses } from "./useClasses.js";
33

44
const styles = {
55
outer: {
6-
"align-self": "flex-start",
7-
padding: "4px",
6+
alignSelf: "flex-start",
7+
padding: 4
88
},
99
row: {
10-
"flex-direction": "row",
10+
flexDirection: "row"
1111
},
1212
color0: {
13-
"background-color": "#14171A",
13+
backgroundColor: "#14171A"
1414
},
1515
color1: {
16-
"background-color": "#AAB8C2",
16+
backgroundColor: "#AAB8C2"
1717
},
1818
color2: {
19-
"background-color": "#E6ECF0",
19+
backgroundColor: "#E6ECF0"
2020
},
2121
color3: {
22-
"background-color": "#FFAD1F",
22+
backgroundColor: "#FFAD1F"
2323
},
2424
color4: {
25-
"background-color": "#F45D22",
25+
backgroundColor: "#F45D22"
2626
},
2727
color5: {
28-
"background-color": "#E0245E",
28+
backgroundColor: "#E0245E"
2929
},
3030
fixed: {
31-
width: "6px",
32-
height: "6px",
33-
},
31+
width: 6,
32+
height: 6
33+
}
3434
};
3535

3636
export default function Box({
@@ -43,24 +43,24 @@ export default function Box({
4343
return (
4444
<div
4545
className={useClasses()({
46-
"align-items": "stretch",
47-
"border-width": "0",
48-
"border-style": "solid",
49-
"box-sizing": "border-box",
46+
alignItems: "stretch",
47+
borderWidth: 0,
48+
borderStyle: "solid",
49+
boxSizing: "border-box",
5050
display: "flex",
51-
"flex-basis": "auto",
52-
"flex-direction": "column",
53-
"flex-shrink": "0",
54-
margin: "0",
55-
padding: "0",
51+
flexBasis: "auto",
52+
flexDirection: "column",
53+
flexShrink: 0,
54+
margin: 0,
55+
padding: 0,
5656
position: "relative",
5757
// fix flexbox bugs
58-
"min-height": "0",
59-
"min-width": "0",
58+
minHeight: 0,
59+
minWidth: 0,
6060
...styles[`color${color}`],
6161
...(fixed ? styles.fixed : {}),
6262
...(layout === "row" ? styles.row : {}),
63-
...(outer ? styles.outer : {}),
63+
...(outer ? styles.outer : {})
6464
})}
6565
{...{ color, fixed, layout, outer, ...props }}
6666
/>

benchmarks/src/implementations/use-classes-published/Dot.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ export default function Dot({ color, size, x, y }) {
99
className={useClasses()({
1010
position: "absolute",
1111
cursor: "pointer",
12-
width: "0",
13-
height: "0",
14-
"border-color": "transparent",
15-
"border-style": "solid",
16-
"border-top-width": "0",
12+
width: 0,
13+
height: 0,
14+
borderColor: "transparent",
15+
borderStyle: "solid",
16+
borderTopWidth: 0,
1717
transform: "translate(50%, 50%)",
18-
"border-right-width": `${size / 2}px`,
19-
"border-bottom-width": `${size / 2}px`,
20-
"border-left-width": `${size / 2}px`,
21-
"margin-left": `${x}px`,
22-
"margin-top": `${y}px`
18+
borderRightWidth: size / 2,
19+
borderBottomWidth: size / 2,
20+
borderLeftWidth: size / 2,
21+
marginLeft: x,
22+
marginTop: y
2323
})}
24-
style={{ "border-bottom-color": color }}
24+
style={{ borderBottomColor: color }}
2525
/>
2626
);
2727
}

benchmarks/src/implementations/use-classes-published/View.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ export default function View({ className, ...props }) {
77
<div
88
{...props}
99
className={useClasses()({
10-
"align-items": "stretch",
11-
"border-width": "0",
12-
"border-style": "solid",
13-
"box-sizing": "border-box",
10+
alignItems: "stretch",
11+
borderWidth: 0,
12+
borderStyle: "solid",
13+
boxSizing: "border-box",
1414
display: "flex",
15-
"flex-basis": "auto",
16-
"flex-direction": "column",
17-
"flex-shrink": "0",
18-
margin: "0",
19-
padding: "0",
15+
flexBasis: "auto",
16+
flexDirection: "column",
17+
flexShrink: 0,
18+
margin: 0,
19+
padding: 0,
2020
position: "relative",
2121
// fix flexbox bugs
22-
"min-height": "0",
23-
"min-width": "0",
22+
minHeight: 0,
23+
minWidth: 0
2424
})}
2525
/>
2626
);

benchmarks/src/implementations/use-classes-themed/Box.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useClasses } from "./useClasses.js";
44
const styles = {
55
outer: {
66
alignSelf: "flex-start",
7-
padding: "4px"
7+
padding: 4
88
},
99
row: {
1010
flexDirection: "row"
@@ -28,8 +28,8 @@ const styles = {
2828
backgroundColor: "#E0245E"
2929
},
3030
fixed: {
31-
width: "6px",
32-
height: "6px"
31+
width: 6,
32+
height: 6
3333
}
3434
};
3535

@@ -44,19 +44,19 @@ export default function Box({
4444
<div
4545
className={useClasses()({
4646
alignItems: "stretch",
47-
borderWidth: "0",
47+
borderWidth: 0,
4848
borderStyle: "solid",
4949
boxSizing: "border-box",
5050
display: "flex",
5151
flexBasis: "auto",
5252
flexDirection: "column",
53-
flexShrink: "0",
54-
margin: "0",
55-
padding: "0",
53+
flexShrink: 0,
54+
margin: 0,
55+
padding: 0,
5656
position: "relative",
5757
// fix flexbox bugs
58-
minHeight: "0",
59-
minWidth: "0",
58+
minHeight: 0,
59+
minWidth: 0,
6060
backgroundColor: theme => theme[`color${color}`],
6161
...(fixed ? styles.fixed : {}),
6262
...(layout === "row" ? styles.row : {}),

benchmarks/src/implementations/use-classes-themed/Dot.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ export default function Dot({ color, size, x, y }) {
99
className={useClasses()({
1010
position: "absolute",
1111
cursor: "pointer",
12-
width: "0",
13-
height: "0",
12+
width: 0,
13+
height: 0,
1414
borderColor: "transparent",
1515
borderStyle: "solid",
16-
borderTopWidth: "0",
16+
borderTopWidth: 0,
1717
transform: "translate(50%, 50%)",
18-
borderRightWidth: `${size / 2}px`,
19-
borderBottomWidth: `${size / 2}px`,
20-
borderLeftWidth: `${size / 2}px`,
21-
marginLeft: `${x}px`,
22-
marginTop: `${y}px`
18+
borderRightWidth: size / 2,
19+
borderBottomWidth: size / 2,
20+
borderLeftWidth: size / 2,
21+
marginLeft: x,
22+
marginTop: y
2323
})}
2424
style={{ borderBottomColor: color }}
2525
/>

benchmarks/src/implementations/use-classes-themed/View.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ export default function View({ className, ...props }) {
88
{...props}
99
className={useClasses()({
1010
alignItems: "stretch",
11-
borderWidth: "0",
11+
borderWidth: 0,
1212
borderStyle: "solid",
1313
boxSizing: "border-box",
1414
display: "flex",
1515
flexBasis: "auto",
1616
flexDirection: "column",
17-
flexShrink: "0",
18-
margin: "0",
19-
padding: "0",
17+
flexShrink: 0,
18+
margin: 0,
19+
padding: 0,
2020
position: "relative",
2121
// fix flexbox bugs
22-
minHeight: "0",
23-
minWidth: "0"
22+
minHeight: 0,
23+
minWidth: 0
2424
})}
2525
/>
2626
);

benchmarks/src/implementations/use-classes/Box.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useClasses } from "./useClasses.js";
44
const styles = {
55
outer: {
66
alignSelf: "flex-start",
7-
padding: "4px"
7+
padding: 4
88
},
99
row: {
1010
flexDirection: "row"
@@ -28,8 +28,8 @@ const styles = {
2828
backgroundColor: "#E0245E"
2929
},
3030
fixed: {
31-
width: "6px",
32-
height: "6px"
31+
width: 6,
32+
height: 6
3333
}
3434
};
3535

@@ -44,19 +44,19 @@ export default function Box({
4444
<div
4545
className={useClasses()({
4646
alignItems: "stretch",
47-
borderWidth: "0",
47+
borderWidth: 0,
4848
borderStyle: "solid",
4949
boxSizing: "border-box",
5050
display: "flex",
5151
flexBasis: "auto",
5252
flexDirection: "column",
53-
flexShrink: "0",
54-
margin: "0",
55-
padding: "0",
53+
flexShrink: 0,
54+
margin: 0,
55+
padding: 0,
5656
position: "relative",
5757
// fix flexbox bugs
58-
minHeight: "0",
59-
minWidth: "0",
58+
minHeight: 0,
59+
minWidth: 0,
6060
...styles[`color${color}`],
6161
...(fixed ? styles.fixed : {}),
6262
...(layout === "row" ? styles.row : {}),

benchmarks/src/implementations/use-classes/Dot.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ export default function Dot({ color, size, x, y }) {
99
className={useClasses()({
1010
position: "absolute",
1111
cursor: "pointer",
12-
width: "0",
13-
height: "0",
12+
width: 0,
13+
height: 0,
1414
borderColor: "transparent",
1515
borderStyle: "solid",
16-
borderTopWidth: "0",
16+
borderTopWidth: 0,
1717
transform: "translate(50%, 50%)",
18-
borderRightWidth: `${size / 2}px`,
19-
borderBottomWidth: `${size / 2}px`,
20-
borderLeftWidth: `${size / 2}px`,
21-
marginLeft: `${x}px`,
22-
marginTop: `${y}px`
18+
borderRightWidth: size / 2,
19+
borderBottomWidth: size / 2,
20+
borderLeftWidth: size / 2,
21+
marginLeft: x,
22+
marginTop: y
2323
})}
2424
style={{ borderBottomColor: color }}
2525
/>

benchmarks/src/implementations/use-classes/View.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ export default function View({ className, ...props }) {
88
{...props}
99
className={useClasses()({
1010
alignItems: "stretch",
11-
borderWidth: "0",
11+
borderWidth: 0,
1212
borderStyle: "solid",
1313
boxSizing: "border-box",
1414
display: "flex",
1515
flexBasis: "auto",
1616
flexDirection: "column",
17-
flexShrink: "0",
18-
margin: "0",
19-
padding: "0",
17+
flexShrink: 0,
18+
margin: 0,
19+
padding: 0,
2020
position: "relative",
2121
// fix flexbox bugs
22-
minHeight: "0",
23-
minWidth: "0"
22+
minHeight: 0,
23+
minWidth: 0
2424
})}
2525
/>
2626
);

0 commit comments

Comments
 (0)