summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/components
diff options
context:
space:
mode:
authorAdam <[email protected]>2026-03-27 20:26:57 -0500
committerGitHub <[email protected]>2026-03-28 01:26:57 +0000
commitf736116967f5b57d89978e51961f2e78eedb443b (patch)
treeeac11218e8114d8d0f14c1b133b2c0594721f11c /packages/ui/src/components
parent82fc493520925cb71323964bff6939e768e6d83a (diff)
downloadopencode-f736116967f5b57d89978e51961f2e78eedb443b.tar.gz
opencode-f736116967f5b57d89978e51961f2e78eedb443b.zip
fix(app): more startup efficiency (#19454)
Diffstat (limited to 'packages/ui/src/components')
-rw-r--r--packages/ui/src/components/font.stories.tsx10
-rw-r--r--packages/ui/src/components/font.tsx64
2 files changed, 6 insertions, 68 deletions
diff --git a/packages/ui/src/components/font.stories.tsx b/packages/ui/src/components/font.stories.tsx
index 153a2c8dc..f4e90bde0 100644
--- a/packages/ui/src/components/font.stories.tsx
+++ b/packages/ui/src/components/font.stories.tsx
@@ -2,24 +2,24 @@
import * as mod from "./font"
const docs = `### Overview
-Loads OpenCode typography assets and mono nerd fonts.
+Uses native system font stacks for sans and mono typography.
-Render once at the app root or Storybook preview.
+Optional compatibility component. Existing roots can keep rendering it, but it does nothing.
### API
- No props.
### Variants and states
-- Fonts include sans and multiple mono families.
+- No variants.
### Behavior
-- Injects @font-face rules and preload links into the document head.
+- Compatibility wrapper only. No font assets are injected or preloaded.
### Accessibility
- Not applicable.
### Theming/tokens
-- Provides font families used by theme tokens.
+- Theme tokens come from CSS variables, not this component.
`
diff --git a/packages/ui/src/components/font.tsx b/packages/ui/src/components/font.tsx
index e1a508f16..f89dfafe1 100644
--- a/packages/ui/src/components/font.tsx
+++ b/packages/ui/src/components/font.tsx
@@ -1,63 +1 @@
-import { Link, Style } from "@solidjs/meta"
-import { Show } from "solid-js"
-import inter from "../assets/fonts/inter.woff2"
-import ibmPlexMonoBold from "../assets/fonts/ibm-plex-mono-bold.woff2"
-import ibmPlexMonoMedium from "../assets/fonts/ibm-plex-mono-medium.woff2"
-import ibmPlexMonoRegular from "../assets/fonts/ibm-plex-mono.woff2"
-
-export const Font = () => {
- return (
- <>
- <Style>{`
- @font-face {
- font-family: "Inter";
- src: url("${inter}") format("woff2-variations");
- font-display: swap;
- font-style: normal;
- font-weight: 100 900;
- }
- @font-face {
- font-family: "Inter Fallback";
- src: local("Arial");
- size-adjust: 100%;
- ascent-override: 97%;
- descent-override: 25%;
- line-gap-override: 1%;
- }
- @font-face {
- font-family: "IBM Plex Mono";
- src: url("${ibmPlexMonoRegular}") format("woff2");
- font-display: swap;
- font-style: normal;
- font-weight: 400;
- }
- @font-face {
- font-family: "IBM Plex Mono";
- src: url("${ibmPlexMonoMedium}") format("woff2");
- font-display: swap;
- font-style: normal;
- font-weight: 500;
- }
- @font-face {
- font-family: "IBM Plex Mono";
- src: url("${ibmPlexMonoBold}") format("woff2");
- font-display: swap;
- font-style: normal;
- font-weight: 700;
- }
- @font-face {
- font-family: "IBM Plex Mono Fallback";
- src: local("Courier New");
- size-adjust: 100%;
- ascent-override: 97%;
- descent-override: 25%;
- line-gap-override: 1%;
- }
- `}</Style>
- <Show when={typeof location === "undefined" || location.protocol !== "file:"}>
- <Link rel="preload" href={inter} as="font" type="font/woff2" crossorigin="anonymous" />
- <Link rel="preload" href={ibmPlexMonoRegular} as="font" type="font/woff2" crossorigin="anonymous" />
- </Show>
- </>
- )
-}
+export const Font = () => null