Skip to content

Commit f5c2108

Browse files
committed
Fix border.
1 parent a4f5ae8 commit f5c2108

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

packages/backend/src/common/commonStroke.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ export const commonStroke = (node: SceneNode): BorderSideType | null => {
1313
}
1414

1515
if ("strokeTopWeight" in node) {
16+
if (
17+
node.strokeTopWeight === node.strokeBottomWeight &&
18+
node.strokeTopWeight === node.strokeLeftWeight &&
19+
node.strokeTopWeight === node.strokeRightWeight
20+
) {
21+
return { all: node.strokeTopWeight / 2 };
22+
}
23+
1624
return {
1725
left: node.strokeLeftWeight / 2,
1826
top: node.strokeTopWeight / 2,

packages/backend/src/html/htmlDefaultBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class HtmlDefaultBuilder {
9090
formatWithJSX(
9191
"border",
9292
this.isJSX,
93-
`${sliceNum(weight)}px ${color} ${borderStyle}`
93+
[sliceNum(weight), color, borderStyle].filter((d) => d).join(" ")
9494
)
9595
);
9696
} else {

packages/backend/src/tailwind/builderImpl/tailwindBorder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const tailwindBorderWidth = (node: SceneNode): string => {
1818
const nearest = nearestValue(weight, allowedValues);
1919
if (nearest === 1) {
2020
// special case
21-
return "border";
21+
return `border${kind}`;
2222
} else {
2323
return `border${kind}-${nearest}`;
2424
}

0 commit comments

Comments
 (0)