Skip to content

Commit ed06a5c

Browse files
committed
Fix rounded--lg
1 parent 729efab commit ed06a5c

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

packages/backend/src/tailwind/conversionTables.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,26 +78,26 @@ const mapFontSize: Record<number, string> = {
7878

7979
const mapBorderRadius: Record<number, string> = {
8080
// 0: "none",
81-
0.125: "-sm",
81+
0.125: "sm",
8282
0.25: "",
83-
0.375: "-md",
84-
0.5: "-lg",
85-
0.75: "-xl",
86-
1.0: "-2xl",
87-
1.5: "-3xl",
88-
10: "-full",
83+
0.375: "md",
84+
0.5: "lg",
85+
0.75: "xl",
86+
1.0: "2xl",
87+
1.5: "3xl",
88+
10: "full",
8989
};
9090

9191
// This uses pixels.
9292
const mapBlur: Record<number, string> = {
93-
0: "-none",
93+
0: "none",
9494
4: "sm",
9595
8: "",
96-
12: "-md",
97-
16: "-lg",
98-
24: "-xl",
99-
40: "-2xl",
100-
64: "-3xl",
96+
12: "md",
97+
16: "lg",
98+
24: "xl",
99+
40: "2xl",
100+
64: "3xl",
101101
};
102102

103103
const mapWidthHeightSize: Record<number, string> = {

packages/backend/src/tailwind/tailwindDefaultBuilder.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,24 +102,23 @@ export class TailwindDefaultBuilder {
102102

103103
const parsedX = sliceNum(x);
104104
const parsedY = sliceNum(y);
105-
if (parsedX === '0') {
105+
if (parsedX === "0") {
106106
this.addAttributes(`left-0`);
107107
} else {
108108
this.addAttributes(`left-[${parsedX}px]`);
109109
}
110-
if (parsedY === '0') {
110+
if (parsedY === "0") {
111111
this.addAttributes(`top-0`);
112-
}
113-
else {
112+
} else {
114113
this.addAttributes(`top-[${parsedY}px]`);
115114
}
116115

117116
this.addAttributes(`absolute`);
118117
} else if (
119118
node.type === "GROUP" ||
120119
("layoutMode" in node &&
121-
((optimizeLayout ? node.inferredAutoLayout : null) ?? node)?.layoutMode ===
122-
"NONE")
120+
((optimizeLayout ? node.inferredAutoLayout : null) ?? node)
121+
?.layoutMode === "NONE")
123122
) {
124123
this.addAttributes("relative");
125124
}
@@ -200,9 +199,7 @@ export class TailwindDefaultBuilder {
200199
if (blur) {
201200
const blurValue = pxToBlur(blur.radius);
202201
if (blurValue) {
203-
this.addAttributes(`blur${blurValue}`);
204-
} else {
205-
this.addAttributes(`blur-[${sliceNum(blur.radius)}px]`);
202+
this.addAttributes(`blur${blurValue ? `-${blurValue}` : ""}`);
206203
}
207204
}
208205

@@ -212,10 +209,10 @@ export class TailwindDefaultBuilder {
212209
if (backgroundBlur) {
213210
const backgroundBlurValue = pxToBlur(backgroundBlur.radius);
214211
if (backgroundBlurValue) {
215-
this.addAttributes(`backdrop-blur${backgroundBlurValue}`);
216-
} else {
217212
this.addAttributes(
218-
`backdrop-blur-[${sliceNum(backgroundBlur.radius)}px]`
213+
`backdrop-blur${
214+
backgroundBlurValue ? `-${backgroundBlurValue}` : ""
215+
}`
219216
);
220217
}
221218
}

0 commit comments

Comments
 (0)