Arc theme
Arc's foundation CSS variables (--accent, --surface, --text-sm, --radius-panel, …) resolved onto Khaeli tokens, so stock Arc and Arc Pro items installed with the shadcn CLI wear the Khaeli palette, type roles, control height and radii. Replaces Arc's own foundation.css.
For a product that uses components written against these variable names beside Khaeli components. Install it after @khaeli/foundation, and in place of the stylesheet those components would otherwise bring: it declares the custom properties they read and points each one at a Khaeli token, so they take the palette, the type roles, the radius ladder and the 30px control, and follow the dark class. It also gives them a keyboard focus outline, 2px in the ring colour. Getting started has the steps. The examples here are plain elements drawn with the theme's variable names; none of them is a component from another library.
Colours
--accent--primary--accent-strong--primary-hover--accent-foreground--primary-foreground--surface--card--surface-muted--secondary--border-subtle--border--text-secondary--muted-foreground--text-muted--subtle-foreground--control-track--input--success--positive--danger--destructive--series-1--chart-1
// Each swatch is filled with a variable the theme declares. Beside it is the Khaeli token it is given.
const colours = [
{ variable: "--accent", token: "--primary" },
{ variable: "--accent-strong", token: "--primary-hover" },
{ variable: "--accent-foreground", token: "--primary-foreground" },
{ variable: "--surface", token: "--card" },
{ variable: "--surface-muted", token: "--secondary" },
{ variable: "--border-subtle", token: "--border" },
{ variable: "--text-secondary", token: "--muted-foreground" },
{ variable: "--text-muted", token: "--subtle-foreground" },
{ variable: "--control-track", token: "--input" },
{ variable: "--success", token: "--positive" },
{ variable: "--danger", token: "--destructive" },
{ variable: "--series-1", token: "--chart-1" },
]
export default function ArcThemeColours() {
return (
<ul className="grid w-full max-w-lg grid-cols-1 gap-x-6 gap-y-3 sm:grid-cols-2">
{colours.map(({ variable, token }) => (
<li key={variable} className="flex min-w-0 items-center gap-3">
<span
aria-hidden="true"
className="size-8 shrink-0 rounded-md ring-1 ring-border ring-inset"
style={{ backgroundColor: `var(${variable})` }}
/>
<span className="flex min-w-0 flex-col font-mono text-xs">
<code>{variable}</code>
<code className="text-muted-foreground">{token}</code>
</span>
</li>
))}
</ul>
)
}
Type
--text-2xl--type-displayThe notes go out on Wednesday--text-xl--type-headingThe notes go out on Wednesday--text-lg--type-titleThe notes go out on Wednesday--text-base--type-titleThe notes go out on Wednesday--text-sm--type-bodyThe notes go out on Wednesday--text-xs--type-captionThe notes go out on Wednesday
// Each line is set with a size variable the theme declares. Beside it is the Khaeli type role it is given.
const sizes = [
{ variable: "--text-2xl", token: "--type-display", leading: "--leading-display" },
{ variable: "--text-xl", token: "--type-heading", leading: "--leading-display" },
{ variable: "--text-lg", token: "--type-title", leading: "--leading-body" },
{ variable: "--text-base", token: "--type-title", leading: "--leading-body" },
{ variable: "--text-sm", token: "--type-body", leading: "--leading-body" },
{ variable: "--text-xs", token: "--type-caption", leading: "--leading-body" },
]
export default function ArcThemeType() {
return (
<ul className="flex w-full flex-col divide-y divide-border border-y border-border">
{sizes.map(({ variable, token, leading }) => (
<li key={variable} className="flex flex-col gap-1 py-3 sm:flex-row sm:items-baseline sm:gap-6">
<span className="flex shrink-0 flex-col font-mono text-xs sm:w-40">
<code>{variable}</code>
<code className="text-muted-foreground">{token}</code>
</span>
<span className="min-w-0" style={{ fontSize: `var(${variable})`, lineHeight: `var(${leading})` }}>
The notes go out on Wednesday
</span>
</li>
))}
</ul>
)
}
Radius and control heights
--radius-panel--radius-card--radius-surface--radius-tray
--control-height-sm--control-height-md--control-height-lg
// Each shape takes its corner from a variable the theme declares. Beside it is the Khaeli radius it is given.
const radii = [
{ variable: "--radius-panel", token: "--radius-card" },
{ variable: "--radius-surface", token: "--radius-tray" },
]
// The theme's three control sizes: the first two are the Khaeli control.
const heights = ["--control-height-sm", "--control-height-md", "--control-height-lg"]
export default function ArcThemeRadiusAndControlHeights() {
return (
<div className="flex w-full max-w-md flex-col gap-8">
<ul className="grid grid-cols-2 gap-4">
{radii.map(({ variable, token }) => (
<li key={variable} className="flex flex-col gap-2">
<span
aria-hidden="true"
className="h-14 ring-1 ring-border ring-inset"
style={{ backgroundColor: "var(--surface-muted)", borderRadius: `var(${variable})` }}
/>
<span className="flex flex-col font-mono text-xs">
<code>{variable}</code>
<code className="text-muted-foreground">{token}</code>
</span>
</li>
))}
</ul>
<ul className="flex flex-wrap items-end gap-4">
{heights.map((variable) => (
<li key={variable} className="flex flex-col gap-2">
<span
aria-hidden="true"
className="w-24"
style={{
height: `var(${variable})`,
borderRadius: "var(--radius-control)",
backgroundColor: "var(--surface)",
boxShadow: "var(--shadow-resting)",
}}
/>
<code className="font-mono text-xs">{variable}</code>
</li>
))}
</ul>
</div>
)
}
A surface
Release 4.2
Twelve tasks shipped and three moved to the next release.
All checks passed
import type { CSSProperties } from "react"
// A panel written the way the items this theme is for are written: every value is one of its variables.
const panel: CSSProperties = {
display: "flex",
flexDirection: "column",
gap: "var(--space-3)",
padding: "var(--space-4)",
borderRadius: "var(--radius-panel)",
backgroundColor: "var(--surface)",
boxShadow: "var(--shadow-resting)",
}
const mark: CSSProperties = {
display: "inline-flex",
alignItems: "center",
height: "var(--control-height-md)",
paddingInline: "var(--space-3)",
fontSize: "var(--text-sm)",
fontWeight: 500,
}
export default function ArcThemeASurface() {
return (
<div className="w-full max-w-xs" style={panel}>
<div>
<p style={{ fontSize: "var(--text-base)", fontWeight: 500 }}>Release 4.2</p>
<p style={{ fontSize: "var(--text-sm)", lineHeight: "var(--leading-body)", color: "var(--text-secondary)" }}>
Twelve tasks shipped and three moved to the next release.
</p>
</div>
<div style={{ display: "flex", flexWrap: "wrap", alignItems: "center", gap: "var(--space-2)" }}>
<span
style={{
...mark,
borderRadius: "var(--radius-control)",
backgroundColor: "var(--accent)",
color: "var(--accent-foreground)",
}}
>
Published
</span>
<span style={{ ...mark, borderRadius: "var(--radius-pill)", backgroundColor: "var(--surface-muted)" }}>
Stable channel
</span>
</div>
<p style={{ fontSize: "var(--text-xs)", color: "var(--success)" }}>All checks passed</p>
</div>
)
}
Installation
npx shadcn@latest add @khaeli/arc-themebunx --bun shadcn@latest add @khaeli/arc-themeInstall after @khaeli/foundation (and again whenever you re-add foundation). Do not import Arc's foundation.css.
Installs with
Nothing else. This item needs no other Registry item and no npm package.
Registry JSON
The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/arc-theme.json