Skip to content

Commit

Permalink
refactor: drop detect-font (#4581)
Browse files Browse the repository at this point in the history
Looks like we don't use it for a long time.
Browser style is used only to convert keywords into unit values.
  • Loading branch information
TrySound authored Dec 13, 2024
1 parent 302f5da commit e703bf8
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 30 deletions.
8 changes: 0 additions & 8 deletions @types/detect-font.d.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { detectFont } from "detect-font";
import type { Style, StyleValue, Unit } from "@webstudio-is/css-engine";
import { keywordValues } from "@webstudio-is/css-data";
import { properties, units } from "@webstudio-is/css-data";
Expand Down Expand Up @@ -68,10 +67,5 @@ export const getBrowserStyle = (element?: Element): Style => {
const computedValue = computedStyle[knownProperty as unknown as number];
browserStyle[knownProperty] = parseValue(knownProperty, computedValue);
}
// We need a single font-family that is actually rendered. Computed style will return a list of potential fonts.
browserStyle.fontFamily = {
type: "fontFamily",
value: [detectFont(element)],
};
return browserStyle;
};
1 change: 0 additions & 1 deletion apps/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
"css-tree": "^2.3.1",
"date-fns": "^3.6.0",
"debug": "^4.3.7",
"detect-font": "^0.1.5",
"downshift": "^6.1.7",
"fast-deep-equal": "^3.1.3",
"immer": "^10.1.1",
Expand Down
15 changes: 0 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e703bf8

Please sign in to comment.