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.

Move body font size and line height to normalize and also fix the values (#1867)

Oleg Isonen42748f27b995
diff --git a/apps/builder/app/builder/features/style-panel/shared/style-info.test.ts b/apps/builder/app/builder/features/style-panel/shared/style-info.test.ts
index 64e58c3daf..3dbc3bb28d 100644
--- a/apps/builder/app/builder/features/style-panel/shared/style-info.test.ts
+++ b/apps/builder/app/builder/features/style-panel/shared/style-info.test.ts
@@ -197,7 +197,7 @@ test("compute inherited styles", () => {
"instanceId": "1",
"value": {
"type": "keyword",
- "value": "Arial",
+ "value": "Arial, sans-serif",
},
},
"fontSize": {
@@ -220,7 +220,7 @@ test("compute inherited styles", () => {
"value": {
"type": "unit",
"unit": "number",
- "value": 1.5,
+ "value": 1.2,
},
},
}
diff --git a/packages/react-sdk/src/css/normalize.ts b/packages/react-sdk/src/css/normalize.ts
index 5e91dae0fe..46603b1b7d 100644
--- a/packages/react-sdk/src/css/normalize.ts
+++ b/packages/react-sdk/src/css/normalize.ts
@@ -124,9 +124,17 @@ export const body = [
property: "fontFamily",
value: {
type: "keyword",
- value: `system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'`,
+ value: "Arial, sans-serif",
},
},
+ {
+ property: "fontSize",
+ value: { type: "unit", unit: "px", value: 16 },
+ },
+ {
+ property: "lineHeight",
+ value: { type: "unit", unit: "number", value: 1.2 },
+ },
boxSizing,
...borders,
] satisfies Styles;
diff --git a/packages/sdk-components-react/src/body.ws.tsx b/packages/sdk-components-react/src/body.ws.tsx
index 4603cf5f1f..398ac5069e 100644
--- a/packages/sdk-components-react/src/body.ws.tsx
+++ b/packages/sdk-components-react/src/body.ws.tsx
@@ -10,21 +10,7 @@ import { props } from "./__generated__/body.props";
import type { defaultTag } from "./body";
const presetStyle = {
- body: [
- ...body,
- {
- property: "fontFamily",
- value: { type: "keyword", value: "Arial" },
- },
- {
- property: "fontSize",
- value: { type: "unit", unit: "px", value: 14 },
- },
- {
- property: "lineHeight",
- value: { type: "unit", unit: "number", value: 1.5 },
- },
- ],
+ body,
} satisfies PresetStyle<typeof defaultTag>;
export const meta: WsComponentMeta = {