Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

borderRadius migration

Oleg Isonen0f641654ca77
diff --git a/codemod/migrate-tokens.ts b/codemod/migrate-tokens.ts
index fd1780f25b..0e0b821693 100644
--- a/codemod/migrate-tokens.ts
+++ b/codemod/migrate-tokens.ts
@@ -198,6 +198,15 @@ const lineHeightValues = new Map([
["20px", "4"],
]);
+const borderRadiusProps = ["borderRadius"];
+const borderRadiusValues = new Map([
+ ["$1", "4"],
+ ["$2", "6"],
+ ["$3", "7"],
+ ["$round", "round"],
+ ["$pill", "pill"],
+]);
+
const updateProperty = (
line: string,
props: Array<string>,
@@ -239,6 +248,12 @@ const update = async ({ filePath, buffer }) => {
lineHeightValues,
"lineHeight"
);
+ line = updateProperty(
+ line,
+ borderRadiusProps,
+ borderRadiusValues,
+ "borderRadius"
+ );
nextLines.push(line);
}
await fs.writeFile(filePath, nextLines.join("\n"));
diff --git a/packages/design-system/src/stitches.config.ts b/packages/design-system/src/stitches.config.ts
index 252e268db5..21a33479f6 100644
--- a/packages/design-system/src/stitches.config.ts
+++ b/packages/design-system/src/stitches.config.ts
@@ -273,13 +273,17 @@ const {
// Legacy - don't use unless specified in Figma
4: "20px",
},
- radii: {
- 1: "4px",
- 2: "6px",
- 3: "8px",
- 4: "12px",
+ borderRadius: {
+ 1: "1px",
+ 2: "2px",
+ 3: "3px",
+ 4: "4px",
+ 5: "5px",
+ 6: "6px",
round: "50%",
pill: "9999px",
+ // Legacy - don't use unless specified in Figma
+ 7: "8px",
},
zIndices: {
1: "100",