Skip to content

Free open-source image editor for the browser

Move to @roprgm/ui 0.8, and wait for Geist instead of the system font (#75)

Rodrigo Belfiore83b0cf7eb8ae
diff --git a/about.html b/about.html
index cf767a3..7f21c15 100644
--- a/about.html
+++ b/about.html
@@ -7,6 +7,13 @@
<meta name="theme-color" content="#171717" />
<link rel="icon" href="/logo.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
+ <link
+ rel="preload"
+ href="./node_modules/@fontsource-variable/geist/files/geist-latin-wght-normal.woff2"
+ as="font"
+ type="font/woff2"
+ crossorigin
+ />
<link rel="canonical" href="https://openlight.app/about" />
<title>About OpenLight | How to edit photos in your browser</title>
<meta name="description" content="What OpenLight is and how to use it: open a photo or camera RAW file, adjust it, edit parts of it with masks, heal, crop, and export, all in your browser." />
@@ -20,7 +27,7 @@
<link rel="stylesheet" href="/src/index.css" />
</head>
<body class="overflow-auto">
- <main class="mx-auto flex max-w-2xl flex-col gap-8 px-6 py-16 text-sm leading-relaxed text-muted">
+ <main class="mx-auto flex max-w-2xl flex-col gap-8 px-6 py-16 text-sm leading-relaxed text-secondary">
<header class="flex flex-col items-start gap-1.5">
<a href="/" class="mb-1.5 rounded-md focus-ring" aria-label="Open the editor">
<img alt="" class="w-12" height="48" src="/logo.svg" width="48" />
diff --git a/bun.lock b/bun.lock
index 4c6d0da..08cc8c0 100644
--- a/bun.lock
+++ b/bun.lock
@@ -8,7 +8,7 @@
"@base-ui/react": "^1.8.0",
"@dnd-kit/core": "^6.3.1",
"@fontsource-variable/geist": "^5.3.0",
- "@roprgm/ui": "^0.7.1",
+ "@roprgm/ui": "^0.8.0",
"@tailwindcss/vite": "^4.3.3",
"@vercel/analytics": "^2.0.1",
"@vercel/speed-insights": "^2.0.0",
@@ -136,7 +136,7 @@
"@rolldown/pluginutils": ["@rolldown/[email protected]", "", {}, "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw=="],
- "@roprgm/ui": ["@roprgm/[email protected]", "", { "dependencies": { "@base-ui/react": "^1.8.0", "class-variance-authority": "^0.7.1", "cn": "^0.4.0" }, "peerDependencies": { "react": ">=19" } }, "sha512-YpRdV1C72wqEMDOnULJYLjDot7AnHon160BJbtZ+C6yNSunbByr8XID+7rF3LcqOpoEUChdfzqtmXuPjeQ9BVw=="],
+ "@roprgm/ui": ["@roprgm/[email protected]", "", { "dependencies": { "@base-ui/react": "^1.8.0", "class-variance-authority": "^0.7.1", "cn": "^0.4.0" }, "peerDependencies": { "react": ">=19" } }, "sha512-jSeDGGJaJH8qZ6bKSqLZW6I+jxgC95Vpjd4kRLf8HToYfWHAY8GYiAMChxXdgiZDjW84e7BRo4YYHPmYYlMTqw=="],
"@standard-schema/spec": ["@standard-schema/[email protected]", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="],
diff --git a/index.html b/index.html
index 02ca32f..0c39175 100644
--- a/index.html
+++ b/index.html
@@ -9,6 +9,13 @@
<meta http-equiv="origin-trial" content="Ag2MmOhk9WrUwkj/P+C+qWF+RFZYjzI3i6mcf09yy2jIgONZstFdmMSV1dw3a57ho/GdNTKkYztMV8QzPeUgVwUAAABgeyJvcmlnaW4iOiJodHRwczovL29wZW5saWdodC5hcHA6NDQzIiwiZmVhdHVyZSI6IldlYk1DUCIsImV4cGlyeSI6MTc5NDg3MzYwMCwiaXNTdWJkb21haW4iOnRydWV9" />
<link rel="icon" href="/logo.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
+ <link
+ rel="preload"
+ href="./node_modules/@fontsource-variable/geist/files/geist-latin-wght-normal.woff2"
+ as="font"
+ type="font/woff2"
+ crossorigin
+ />
<link rel="canonical" href="https://openlight.app/" />
<title>OpenLight | Free online photo and RAW editor</title>
<meta name="description" content="Edit photos and camera RAW files in your browser for free. An open-source photo editor on WebGPU with layers, masks, and healing. Photos never leave your device." />
diff --git a/package.json b/package.json
index 7ae8f3e..4df5917 100644
--- a/package.json
+++ b/package.json
@@ -15,7 +15,7 @@
"@base-ui/react": "^1.8.0",
"@dnd-kit/core": "^6.3.1",
"@fontsource-variable/geist": "^5.3.0",
- "@roprgm/ui": "^0.7.1",
+ "@roprgm/ui": "^0.8.0",
"@tailwindcss/vite": "^4.3.3",
"@vercel/analytics": "^2.0.1",
"@vercel/speed-insights": "^2.0.0",
diff --git a/src/app/assistant/index.tsx b/src/app/assistant/index.tsx
index 533ae69..3c2d9c4 100644
--- a/src/app/assistant/index.tsx
+++ b/src/app/assistant/index.tsx
@@ -172,7 +172,7 @@ export function Assistant({
aria-label="Assistant"
onClick={() => show(true)}
className={cn(
- "absolute bottom-0 left-0 grid size-10 place-items-center text-muted transition-colors hover:text-foreground",
+ "absolute bottom-0 left-0 grid size-10 place-items-center text-secondary transition-colors hover:text-foreground",
open ? vanish : appear,
)}
>
@@ -219,7 +219,7 @@ export function Assistant({
key={index}
ref={index === messages.length - 1 ? newest : undefined}
className={
- message.from === "user" ? "font-medium" : "text-muted"
+ message.from === "user" ? "font-medium" : "text-secondary"
}
>
{message.text}
diff --git a/src/app/editor/empty.tsx b/src/app/editor/empty.tsx
index a6a095f..fbaaec1 100644
--- a/src/app/editor/empty.tsx
+++ b/src/app/editor/empty.tsx
@@ -61,7 +61,7 @@ function Status({ state, onOpen }: { state: EmptyState } & OpenProps) {
if (state.status === "error") {
return (
<>
- <p className="max-w-md text-center text-muted">
+ <p className="max-w-md text-center text-secondary">
Couldn't open {state.file}: {state.error}
</p>
<OpenImage onOpen={onOpen} />
@@ -78,7 +78,7 @@ function Status({ state, onOpen }: { state: EmptyState } & OpenProps) {
width="64"
/>
<h1 className="text-2xl font-bold">OpenLight</h1>
- <p className="text-muted">Edit photos in your browser.</p>
+ <p className="text-secondary">Edit photos in your browser.</p>
<OpenImage onOpen={onOpen} />
</>
);
diff --git a/src/app/editor/export/index.tsx b/src/app/editor/export/index.tsx
index c858019..e580813 100644
--- a/src/app/editor/export/index.tsx
+++ b/src/app/editor/export/index.tsx
@@ -72,7 +72,7 @@ function FormatSelect({
}) {
return (
<div className="space-y-2">
- <div className="flex items-center justify-between text-muted">
+ <div className="flex items-center justify-between text-secondary">
Format
<Select
raised
@@ -89,7 +89,7 @@ function FormatSelect({
}}
/>
</div>
- <p className="text-muted">{value.description}</p>
+ <p className="text-secondary">{value.description}</p>
</div>
);
}
@@ -117,7 +117,7 @@ function SizeFields({
onChange(Math.max(1, Math.round(maxEdge * fraction)));
return (
// Units follow their digits, as in a slider; the values' 4px padding reaches past the file size's edge.
- <div className="grid grid-cols-[auto_1fr] items-center gap-x-3 gap-y-2 text-muted">
+ <div className="grid grid-cols-[auto_1fr] items-center gap-x-3 gap-y-2 text-secondary">
<span>Width</span>
<ScrubInput
aria-label="Width"
@@ -185,7 +185,7 @@ function SaveScene() {
aria-label="Scene export"
className="flex flex-col gap-3 p-3.5 shadow-[inset_0_1px_0_var(--color-edge)]"
>
- <p className="text-muted">
+ <p className="text-secondary">
Saves the photo and every edit in one file. Open it to continue editing.
</p>
<Button size="lg" className="w-full" onClick={save}>
@@ -273,7 +273,7 @@ export function ExportMode({ onClose }: { onClose: () => void }) {
<span
className={cn(
"flex items-center justify-end gap-1.5 text-foreground tabular-nums",
- pending && "text-muted",
+ pending && "text-secondary",
)}
>
{encoded ? formatBytes(encoded.bytes) : "…"}
diff --git a/src/app/editor/header.tsx b/src/app/editor/header.tsx
index 002254b..d4f7d32 100644
--- a/src/app/editor/header.tsx
+++ b/src/app/editor/header.tsx
@@ -28,7 +28,7 @@ export function EditorHeader({
<Tooltip>
<TooltipTrigger
render={
- <span className="min-w-0 truncate text-muted">{file}</span>
+ <span className="min-w-0 truncate text-secondary">{file}</span>
}
/>
<TooltipContent>{file}</TooltipContent>
diff --git a/src/app/editor/index.tsx b/src/app/editor/index.tsx
index 8d5049d..fadf8a4 100644
--- a/src/app/editor/index.tsx
+++ b/src/app/editor/index.tsx
@@ -1,4 +1,5 @@
import { Button } from "@roprgm/ui/button";
+import { Separator } from "@roprgm/ui/separator";
import { Tooltip, TooltipContent, TooltipTrigger } from "@roprgm/ui/tooltip";
import type { ReactNode } from "react";
import type { Workspace } from "@/app/workspace";
@@ -101,7 +102,7 @@ function ExportButton() {
<Button
size="sm"
aria-pressed={exporting}
- className="ml-1 aria-pressed:bg-raised-hover pointer-coarse:h-8"
+ className="ml-1 aria-pressed:bg-control-hover pointer-coarse:h-8"
onClick={() => setTool(exporting ? tools[0] : exportTool)}
>
Export
@@ -187,10 +188,7 @@ function DocumentEditor({
open={<OpenButton onOpen={onOpen} />}
>
<HistoryControls />
- <hr
- aria-orientation="vertical"
- className="mx-1 h-4 w-px border-0 separator"
- />
+ <Separator orientation="vertical" className="mx-1 my-auto h-4" />
<ComparisonControl />
<ExportButton />
</EditorHeader>
diff --git a/src/app/editor/open.tsx b/src/app/editor/open.tsx
index 19290fb..95132c4 100644
--- a/src/app/editor/open.tsx
+++ b/src/app/editor/open.tsx
@@ -51,7 +51,7 @@ export function FileInput({
export function OpenImage({ onOpen }: OpenProps) {
const input = useRef<HTMLInputElement>(null);
return (
- <p className="mt-4 text-muted">
+ <p className="mt-4 text-secondary">
Drop an image here or{" "}
<TextLink onClick={() => input.current?.click()}>choose a file</TextLink>
<FileInput ref={input} onOpen={onOpen} />
diff --git a/src/app/editor/tool-rail.tsx b/src/app/editor/tool-rail.tsx
index 6bcb887..afc61c8 100644
--- a/src/app/editor/tool-rail.tsx
+++ b/src/app/editor/tool-rail.tsx
@@ -25,7 +25,7 @@ function RailLink({
target="_blank"
rel="noreferrer"
aria-label={label}
- className="grid place-items-center rounded-md p-1.5 text-muted transition-colors hover:bg-hover hover:text-foreground"
+ className="grid place-items-center rounded-md p-1.5 text-secondary transition-colors hover:bg-hover hover:text-foreground"
/>
}
>
diff --git a/src/components/editor/dock.tsx b/src/components/editor/dock.tsx
index fbaa5fa..b0cdb24 100644
--- a/src/components/editor/dock.tsx
+++ b/src/components/editor/dock.tsx
@@ -78,7 +78,7 @@ export function DockChips<T extends string>({
function Readout({ parameter }: { parameter: Parameter }) {
return (
<p className="flex items-baseline gap-2 whitespace-nowrap">
- <span className="text-muted">{parameter.label}</span>
+ <span className="text-secondary">{parameter.label}</span>
<span className="font-medium text-foreground tabular-nums">
{formatValue(parameter.value, parameter.step, parameter.format)}
</span>
@@ -90,7 +90,7 @@ function Readout({ parameter }: { parameter: Parameter }) {
function Picked({ parameter }: { parameter: Parameter }) {
return (
<p className="flex items-center gap-2 whitespace-nowrap">
- <span className="text-muted">{parameter.label}</span>
+ <span className="text-secondary">{parameter.label}</span>
<ScrubInput
{...parameter}
aria-label={parameter.label}
@@ -172,7 +172,7 @@ export function DockControls({
>
{hint && (
// Above the histogram and zoom control, which sit in the canvas's bottom corners.
- <p className="pointer-events-none absolute bottom-full left-1/2 z-10 mb-21 w-72 max-w-[calc(100%-1.5rem)] -translate-x-1/2 rounded-md bg-level-4/80 px-3 py-1.5 text-center text-balance text-muted backdrop-blur-sm">
+ <p className="pointer-events-none absolute bottom-full left-1/2 z-10 mb-21 w-72 max-w-[calc(100%-1.5rem)] -translate-x-1/2 rounded-md bg-level-4/80 px-3 py-1.5 text-center text-balance text-secondary backdrop-blur-sm">
Drag a dial to change it, double{"\u2011"}tap to reset, tap to type a
value
</p>
diff --git a/src/components/editor/panel.tsx b/src/components/editor/panel.tsx
index 1572058..ddb625b 100644
--- a/src/components/editor/panel.tsx
+++ b/src/components/editor/panel.tsx
@@ -42,7 +42,7 @@ export function EditorPanel({
{...props}
>
<div
- className="absolute inset-y-0 -left-1 z-20 w-2 cursor-col-resize touch-none after:absolute after:inset-y-0 after:left-1 after:w-px after:transition-colors hover:after:bg-raised"
+ className="absolute inset-y-0 -left-1 z-20 w-2 cursor-col-resize touch-none after:absolute after:inset-y-0 after:left-1 after:w-px after:transition-colors hover:after:bg-control"
onPointerDown={(event) =>
event.currentTarget.setPointerCapture(event.pointerId)
}
diff --git a/src/components/gpu-stats.tsx b/src/components/gpu-stats.tsx
index 7779231..fb231ea 100644
--- a/src/components/gpu-stats.tsx
+++ b/src/components/gpu-stats.tsx
@@ -16,7 +16,7 @@ const megabytes = (bytes: number) => `${(bytes / 2 ** 20).toFixed(1)} MB`;
function Row({ label, value }: { label: string; value: string }) {
return (
<>
- <dt className="text-muted">{label}</dt>
+ <dt className="text-secondary">{label}</dt>
<dd>{value}</dd>
</>
);
diff --git a/src/components/ui/dial.tsx b/src/components/ui/dial.tsx
index b8fa972..cfd5088 100644
--- a/src/components/ui/dial.tsx
+++ b/src/components/ui/dial.tsx
@@ -83,7 +83,7 @@ function Arc({
<circle className="stroke-hover" cx="24" cy="24" r={radius} />
{length > 0.1 && (
<circle
- className="stroke-muted group-data-[scrubbing=true]:stroke-foreground group-data-[selected=true]:stroke-foreground"
+ className="stroke-secondary group-data-[scrubbing=true]:stroke-foreground group-data-[selected=true]:stroke-foreground"
cx="24"
cy="24"
r={radius}
@@ -233,9 +233,9 @@ export function Dial({
>
<span
className={cn(
- "relative grid place-items-center rounded-full surface-sunken tabular-nums transition group-data-[scrubbing=true]:scale-108",
+ "relative grid place-items-center rounded-full surface-field tabular-nums transition group-data-[scrubbing=true]:scale-108",
color ? "size-9" : "size-11.5",
- edited ? "text-foreground" : "text-faint",
+ edited ? "text-foreground" : "text-muted",
)}
>
<Arc value={value} min={min} max={max} origin={origin} />
@@ -250,7 +250,7 @@ export function Dial({
</span>
<span
className={cn(
- "whitespace-nowrap text-muted group-data-[scrubbing=true]:text-foreground group-data-[selected=true]:text-foreground",
+ "whitespace-nowrap text-secondary group-data-[scrubbing=true]:text-foreground group-data-[selected=true]:text-foreground",
color && "tabular-nums",
)}
>
diff --git a/src/components/ui/text-link.tsx b/src/components/ui/text-link.tsx
index 64fdba0..546b3c1 100644
--- a/src/components/ui/text-link.tsx
+++ b/src/components/ui/text-link.tsx
@@ -11,7 +11,7 @@ const link = cva(
default:
"text-foreground decoration-disabled hover:decoration-foreground",
muted:
- "decoration-level-6 hover:text-foreground hover:decoration-muted",
+ "decoration-level-6 hover:text-foreground hover:decoration-secondary",
},
},
defaultVariants: { variant: "default" },
diff --git a/src/features/crop/overlay.tsx b/src/features/crop/overlay.tsx
index a43522f..9fb68ef 100644
--- a/src/features/crop/overlay.tsx
+++ b/src/features/crop/overlay.tsx
@@ -153,7 +153,7 @@ export function CropOverlay({
className="group absolute flex size-11 min-h-11 min-w-11 -translate-1/2 items-center justify-center outline-none data-[handle=n]:w-full data-[handle=s]:w-full data-[handle=e]:h-full data-[handle=w]:h-full"
style={{ left: `${left}%`, top: `${top}%`, cursor }}
>
- <span className="pointer-events-none size-2.5 surface-primary group-focus-visible:ring-2 group-focus-visible:ring-focus" />
+ <span className="pointer-events-none size-2.5 surface-accent group-focus-visible:ring-2 group-focus-visible:ring-focus" />
</button>
))}
</div>
diff --git a/src/features/crop/view.tsx b/src/features/crop/view.tsx
index 63f5b61..a915d6d 100644
--- a/src/features/crop/view.tsx
+++ b/src/features/crop/view.tsx
@@ -213,7 +213,7 @@ export function CropEditor({ onClose }: { onClose: () => void }) {
<Button variant="ghost" size="sm" onClick={reset}>
Reset
</Button>
- <span className="flex-1 truncate text-center text-muted tabular-nums">
+ <span className="flex-1 truncate text-center text-secondary tabular-nums">
{size}
</span>
<Button variant="ghost" size="sm" onClick={onClose}>
@@ -249,7 +249,7 @@ export function CropEditor({ onClose }: { onClose: () => void }) {
>
<PanelBody header={<PanelHeader title="Crop" onClose={onClose} />}>
<section aria-label="Crop tool" className="space-y-5 p-3.5">
- <div className="flex items-center justify-between text-muted">
+ <div className="flex items-center justify-between text-secondary">
Aspect ratio
<Select
raised
@@ -266,7 +266,7 @@ export function CropEditor({ onClose }: { onClose: () => void }) {
aria-label="Rotate and flip image"
className="grid grid-cols-4 items-center gap-2"
>
- <h3 className="col-span-3 text-muted">Rotate & flip</h3>
+ <h3 className="col-span-3 text-secondary">Rotate & flip</h3>
<Button
variant="ghost"
size="sm"
@@ -284,11 +284,11 @@ export function CropEditor({ onClose }: { onClose: () => void }) {
))}
</section>
<Slider {...rotation} />
- <p className="text-muted">
+ <p className="text-secondary">
Drag edges or corners to crop, inside to move, outside to
rotate. Space + drag to pan; Ctrl/⌘ + scroll to zoom.
</p>
- <p className="tabular-nums text-muted">{size}</p>
+ <p className="tabular-nums text-secondary">{size}</p>
</section>
</PanelBody>
<div className="p-3">
diff --git a/src/features/fill/controls.tsx b/src/features/fill/controls.tsx
index 0fb2c00..eda51cf 100644
--- a/src/features/fill/controls.tsx
+++ b/src/features/fill/controls.tsx
@@ -17,7 +17,7 @@ export function FillControls({ id, fill }: { id: string; fill: Fill }) {
}, [document]);
return (
<section className="flex flex-col gap-3 p-3.5">
- <label className="flex items-center justify-between text-muted">
+ <label className="flex items-center justify-between text-secondary">
Color
<span className="flex items-center gap-2">
<span className="text-foreground uppercase tabular-nums">
@@ -28,7 +28,7 @@ export function FillControls({ id, fill }: { id: string; fill: Fill }) {
type="color"
aria-label="Color"
value={fill.color}
- className="h-6 w-9 cursor-pointer rounded surface-sunken p-0.5"
+ className="h-6 w-9 cursor-pointer rounded surface-field p-0.5"
onChange={(event) => {
document.history.begin();
setFill(document, { color: event.currentTarget.value }, id);
@@ -36,7 +36,7 @@ export function FillControls({ id, fill }: { id: string; fill: Fill }) {
/>
</span>
</label>
- <div className="flex items-center justify-between text-muted">
+ <div className="flex items-center justify-between text-secondary">
Blend
<Select
raised
diff --git a/src/features/heal/controls.tsx b/src/features/heal/controls.tsx
index 53e4b1b..daa3356 100644
--- a/src/features/heal/controls.tsx
+++ b/src/features/heal/controls.tsx
@@ -16,7 +16,7 @@ function PendingThumbnail() {
<span
role="img"
aria-label="Patch pending"
- className="grid size-8 shrink-0 place-items-center rounded-sm border border-level-8 bg-level-1 text-muted"
+ className="grid size-8 shrink-0 place-items-center rounded-sm border border-level-8 bg-level-1 text-secondary"
>
<HealIcon className="size-4" />
</span>
@@ -97,7 +97,7 @@ export function HealControls({
);
if (!patches.length) {
return (
- <p className="p-4 text-center text-muted">
+ <p className="p-4 text-center text-secondary">
Paint over a spot or object to create the first patch.
</p>
);
@@ -127,7 +127,7 @@ export function HealControls({
fallback={<PendingThumbnail />}
/>
<span className="min-w-0 flex-1 truncate">Patch {index + 1}</span>
- <span className="shrink-0 text-muted tabular-nums">
+ <span className="shrink-0 text-secondary tabular-nums">
{patchSummary(patch)}
</span>
</button>
diff --git a/src/features/layers/controls.tsx b/src/features/layers/controls.tsx
index ea34c82..6d82cf5 100644
--- a/src/features/layers/controls.tsx
+++ b/src/features/layers/controls.tsx
@@ -66,7 +66,7 @@ function LayerThumbnail({
}
const Icon = effects.find(({ kind }) => kind === layer.kind)?.Icon;
return (
- <span className="grid size-8 shrink-0 place-items-center rounded border border-edge/50 bg-level-1/40 text-muted">
+ <span className="grid size-8 shrink-0 place-items-center rounded border border-edge/50 bg-level-1/40 text-secondary">
{Icon && <Icon className="size-4" />}
</span>
);
@@ -117,7 +117,7 @@ const LayerRow = memo(function LayerRow({
selected={selected === layer.id}
muted={!visible}
style={{ paddingLeft: depth * 12 }}
- className="gap-0 pointer-coarse:h-12 data-[dragging=true]:opacity-40 data-[drop=inside]:ring-1 data-[drop=inside]:ring-primary data-[drop=inside]:ring-inset data-[drop=before]:before:absolute data-[drop=before]:before:inset-x-0 data-[drop=before]:before:-top-px data-[drop=before]:before:border-t-2 data-[drop=before]:before:border-primary data-[drop=after]:after:absolute data-[drop=after]:after:inset-x-0 data-[drop=after]:after:-bottom-px data-[drop=after]:after:border-b-2 data-[drop=after]:after:border-primary"
+ className="gap-0 pointer-coarse:h-12 data-[dragging=true]:opacity-40 data-[drop=inside]:ring-1 data-[drop=inside]:ring-accent data-[drop=inside]:ring-inset data-[drop=before]:before:absolute data-[drop=before]:before:inset-x-0 data-[drop=before]:before:-top-px data-[drop=before]:before:border-t-2 data-[drop=before]:before:border-accent data-[drop=after]:after:absolute data-[drop=after]:after:inset-x-0 data-[drop=after]:after:-bottom-px data-[drop=after]:after:border-b-2 data-[drop=after]:after:border-accent"
>
<Tooltip disabled={isImage}>
<TooltipTrigger
@@ -132,7 +132,7 @@ const LayerRow = memo(function LayerRow({
setLayer(document, layer.id, { visible: !visible });
}
}}
- className="grid h-full w-8 shrink-0 place-items-center text-muted hover:text-foreground disabled:text-disabled aria-[pressed=false]:text-disabled pointer-coarse:w-11"
+ className="grid h-full w-8 shrink-0 place-items-center text-secondary hover:text-foreground disabled:text-disabled aria-[pressed=false]:text-disabled pointer-coarse:w-11"
>
<Icon className="size-3.5">
<path d="M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12Z" />
@@ -162,7 +162,7 @@ const LayerRow = memo(function LayerRow({
<Tooltip>
<TooltipTrigger
render={
- <span className="grid size-6 shrink-0 place-items-center text-muted">
+ <span className="grid size-6 shrink-0 place-items-center text-secondary">
{maskSign}
</span>
}
@@ -180,7 +180,7 @@ const LayerRow = memo(function LayerRow({
aria-label={expandLabel}
aria-expanded={expanded}
onClick={() => setCollapsed(expanded)}
- className="grid size-6 shrink-0 place-items-center text-muted hover:text-foreground"
+ className="grid size-6 shrink-0 place-items-center text-secondary hover:text-foreground"
>
<Icon className="size-3 transition-transform" style={chevronStyle}>
<path d="m9 5 7 7-7 7" />
@@ -192,7 +192,7 @@ const LayerRow = memo(function LayerRow({
<Tooltip>
<TooltipTrigger
render={
- <span className="grid size-7 shrink-0 place-items-center text-muted">
+ <span className="grid size-7 shrink-0 place-items-center text-secondary">
<Icon className="size-3.5">
<rect x="6" y="10" width="12" height="10" rx="2" />
<path d="M8 10V7a4 4 0 0 1 8 0v3" />
diff --git a/src/features/layers/layer-name.tsx b/src/features/layers/layer-name.tsx
index 00f3935..8965f7c 100644
--- a/src/features/layers/layer-name.tsx
+++ b/src/features/layers/layer-name.tsx
@@ -23,7 +23,7 @@ export function LayerName({
aria-label="Layer name"
ref={(input) => input?.select()}
defaultValue={layer.name}
- className="min-w-0 flex-1 rounded surface-sunken px-1 text-foreground outline-none"
+ className="min-w-0 flex-1 rounded surface-field px-1 text-foreground outline-none"
onKeyDown={(event) => {
if (event.key === "Enter") {
event.currentTarget.blur();
diff --git a/src/features/layers/mask-options.tsx b/src/features/layers/mask-options.tsx
index 58a1827..9858a64 100644
--- a/src/features/layers/mask-options.tsx
+++ b/src/features/layers/mask-options.tsx
@@ -1,4 +1,5 @@
import { Select } from "@roprgm/ui/select";
+import { Separator } from "@roprgm/ui/separator";
import { Slider } from "@roprgm/ui/slider";
import { useDocument, useScene } from "@/components/editor/session";
import { barSlider, useBarDensity } from "@/components/editor/toolbar-density";
@@ -20,10 +21,7 @@ export function MaskOptions({ layer }: { layer: MaskLayer }) {
return (
<>
{density !== "menu" && (
- <hr
- aria-orientation="vertical"
- className="h-4 w-px border-0 separator"
- />
+ <Separator orientation="vertical" className="my-auto h-4" />
)}
{layer.mask.kind === "radial" && (
<Slider
diff --git a/src/features/layers/thumbnails.tsx b/src/features/layers/thumbnails.tsx
index 09dde82..b9528a2 100644
--- a/src/features/layers/thumbnails.tsx
+++ b/src/features/layers/thumbnails.tsx
@@ -72,7 +72,7 @@ export function MaskThumbnail({ layer }: { layer: MaskLayer }) {
<span
role="img"
aria-label="Empty brush thumbnail"
- className={`grid place-items-center text-muted ${frame}`}
+ className={`grid place-items-center text-secondary ${frame}`}
>
<Icon className="size-4">
<path d="M10 14a3 3 0 0 1-3 3c-1.5 0-3-1-3-1s2-1 2-2.5c0-1.5 1-2.5 2.5-2.5M11 13l7-7a1.4 1.4 0 0 0-2-2l-7 7" />
diff --git a/src/features/lut/curves.tsx b/src/features/lut/curves.tsx
index d215590..ba0f12e 100644
--- a/src/features/lut/curves.tsx
+++ b/src/features/lut/curves.tsx
@@ -36,7 +36,7 @@ export function LutCurves({
}) {
return (
<section className="flex flex-col gap-2.5">
- <h2 className="text-muted">Gray response</h2>
+ <h2 className="text-secondary">Gray response</h2>
<svg
role="img"
aria-label="Each channel's output for grays from black to white"
diff --git a/src/features/paint/colors.tsx b/src/features/paint/colors.tsx
index b7d20f7..f4e9b7d 100644
--- a/src/features/paint/colors.tsx
+++ b/src/features/paint/colors.tsx
@@ -52,7 +52,7 @@ function Swatch({
render={
<label
className={cn(
- "absolute size-4.5 cursor-pointer rounded-sm surface-raised focus-ring",
+ "absolute size-4.5 cursor-pointer rounded-sm surface-control focus-ring",
className,
)}
style={{ backgroundColor: value }}
diff --git a/src/features/paint/controls.tsx b/src/features/paint/controls.tsx
index 780e39b..84fc5a4 100644
--- a/src/features/paint/controls.tsx
+++ b/src/features/paint/controls.tsx
@@ -7,7 +7,7 @@ import { setPaintBlend } from "./edits";
export function PaintControls({ layer }: { layer: PaintLayer }) {
const document = useDocument();
return (
- <section className="flex items-center justify-between p-3.5 text-muted">
+ <section className="flex items-center justify-between p-3.5 text-secondary">
Blend
<Select
raised
diff --git a/src/features/tone-curves/tone-curves.tsx b/src/features/tone-curves/tone-curves.tsx
index 2fe1f75..71cc17f 100644
--- a/src/features/tone-curves/tone-curves.tsx
+++ b/src/features/tone-curves/tone-curves.tsx
@@ -26,7 +26,7 @@ export function ToneCurves({
>
{!fill && (
<div className="flex items-center justify-between">
- <h2 className="text-muted">Curves</h2>
+ <h2 className="text-secondary">Curves</h2>
<Button
variant="ghost"
aria-label="Reset curve"
diff --git a/src/features/white-balance/controls.tsx b/src/features/white-balance/controls.tsx
index 11e2930..8f43808 100644
--- a/src/features/white-balance/controls.tsx
+++ b/src/features/white-balance/controls.tsx
@@ -94,7 +94,7 @@ function Action({ label, onClick }: { label: string; onClick: () => void }) {
return (
<button
type="button"
- className="pointer-events-auto cursor-pointer text-muted hover:text-foreground"
+ className="pointer-events-auto cursor-pointer text-secondary hover:text-foreground"
onClick={onClick}
>
{label}
diff --git a/src/index.css b/src/index.css
index 55c5e86..5a3d04d 100644
--- a/src/index.css
+++ b/src/index.css
@@ -8,11 +8,12 @@
--color-edge: oklch(0% 0 0);
}
-/* `optional` never swaps after first paint, so the font can't cause layout shift. */
+/* `block` waits for Geist instead of painting a fallback first; the page preloads the file, so
+ the wait is short and text never shows in another font. */
@font-face {
font-family: "Geist Variable";
font-style: normal;
- font-display: optional;
+ font-display: block;
font-weight: 100 900;
src: url("@fontsource-variable/geist/files/geist-latin-wght-normal.woff2")
format("woff2-variations");
diff --git a/src/main.tsx b/src/main.tsx
index 594f481..f48dcbd 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -31,12 +31,12 @@ class GpuBoundary extends Component<
<main className="grid h-dvh place-content-center justify-items-center gap-3 p-6 text-center">
<img alt="" className="w-16" height="64" src="/logo.svg" width="64" />
<h1 className="text-2xl font-bold">OpenLight</h1>
- <p className="text-muted">Edit photos in your browser.</p>
- <p className="max-w-md text-muted">
+ <p className="text-secondary">Edit photos in your browser.</p>
+ <p className="max-w-md text-secondary">
OpenLight needs WebGPU, which this browser does not provide. Open it
in a recent Chrome, Edge, Safari, or Firefox.
</p>
- <p className="text-muted">{String(this.state.error)}</p>
+ <p className="text-secondary">{String(this.state.error)}</p>
<TextLink href="https://github.com/roprgm/openlight">
github.com/roprgm/openlight
</TextLink>