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.

prepare fontSizes migration

Oleg Isonen330177b45b8f
diff --git a/codemod/migrate-spacing.ts b/codemod/migrate-tokens.ts
similarity index 95%
rename from codemod/migrate-spacing.ts
rename to codemod/migrate-tokens.ts
index 7999d22410..4b1b76f069 100644
--- a/codemod/migrate-spacing.ts
+++ b/codemod/migrate-tokens.ts
@@ -177,6 +177,14 @@ const spaceValues = new Map([
["8px", "5"],
]);
+const fontSizeProps = ["fontSize"];
+const fontSizeValues = new Map([
+ ["$1", "1"],
+ ["$2", "3"],
+ ["$3", "4"],
+ ["$4", "1"],
+]);
+
const updateProperty = (
line: string,
props: Array<string>,
@@ -211,6 +219,7 @@ const update = async ({ filePath, buffer }) => {
let line: string = "";
for (line of lines) {
line = updateProperty(line, spaceProps, spaceValues, "spacing");
+ line = updateProperty(line, fontSizeProps, fontSizeValues, "fontSizes");
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 2f2de88c48..a070222ab4 100644
--- a/packages/design-system/src/stitches.config.ts
+++ b/packages/design-system/src/stitches.config.ts
@@ -255,15 +255,10 @@ const {
},
spacing,
fontSizes: {
- 1: "12px",
- 2: "13px",
- 3: "15px",
- 4: "17px",
- 5: "19px",
- 6: "21px",
- 7: "27px",
- 8: "35px",
- 9: "59px",
+ 1: "8px",
+ 2: "10px",
+ 3: "12px",
+ 4: "14px",
},
radii: {
1: "4px",