Getting Started

Theming

Replace the default theme with your brand — one config file, every component.

Inkline components have no brand of their own. Their appearance comes entirely from design tokens, so making them match your product is a matter of changing the tokens once rather than overriding CSS at every call site.

The tokens are styleframe's. Inkline components consume them; styleframe defines them and generates the stylesheet. This page covers the part you need to theme Inkline. For the full token, utility and modifier reference — several hundred entries — go to styleframe's documentation; we do not restate it here.

How it fits together

The stylesheet you imported in Installation is a build of styleframe's default theme. To use your own, you stop importing that file and generate one instead:

  1. Add a styleframe.config.ts to your project.
  2. Run the styleframe CLI to build it into a stylesheet.
  3. Import that stylesheet instead of @inkline/<framework>/css.

Nothing about your component code changes.

Set up the config

Install styleframe's theme and CLI:

npm install --save-dev styleframe @styleframe/theme @styleframe/cli

Create styleframe.config.ts at the root of your project. This is the default theme, unmodified — the baseline you customize from:

styleframe.config.ts
import {
  useDesignTokensPreset,
  useGlobalPreset,
  useModifiersPreset,
  useSanitizePreset,
  useUtilitiesPreset,
} from "@styleframe/theme";
import { styleframe } from "styleframe";

const s = styleframe();

useDesignTokensPreset(s);
useSanitizePreset(s);
useGlobalPreset(s);
useUtilitiesPreset(s);
useModifiersPreset(s);

export default s;

Build it:

npx styleframe build
ℹ Loading configuration from "styleframe.config.ts"...
ℹ Building styleframe...
✔ Styleframe built successfully!

The stylesheet lands at styleframe/index.css. Pass --outputDir to put it somewhere else. Import it from your app's entry point in place of the bundled one:

src/main.ts
import "./styleframe/index.css";

Add the build to your package.json so it runs before every build:

package.json
{
  "scripts": {
    "prebuild": "styleframe build"
  }
}

Change your brand color

useDesignTokensPreset takes a config object. Give it a color and it generates the entire ramp — 50 through 950, plus the state variations components use for hover, focus and active:

styleframe.config.ts
useDesignTokensPreset(s, {
  colors: {
    primary: "#ff6600",
    secondary: "#1f2933",
  },
});

Rebuild, and every component that reads primary follows — buttons, switches, focus rings, the lot. The generated variable changes from the default:

--color--primary: oklch(0.5382046311912811 0.1007734410314357 223.6416081733415 / 1);

to your brand, with the whole ramp regenerated around it:

--color--primary: oklch(0.6957934102753723 0.2042590816060513 43.49103102933585 / 1);
--color--primary-500: oklch(0.55 0.1615 43.49 / 1);

You never write those values yourself. You give styleframe a hex; it derives a perceptually even scale in OKLCH.

Change spacing, radii and type

The same config object covers the rest of the token domains. Squaring off every corner in the product is one line:

styleframe.config.ts
useDesignTokensPreset(s, {
  colors: { primary: "#ff6600" },
  borderRadius: { md: "0.125rem" },
});
--border-radius--md: 0.125rem;

spacing, fontSize, fontWeight, boxShadow, easing and the typographic scale work the same way. Set easing: false — or any other domain to false — to drop it from the output entirely.

Override a single component

Tokens are the right tool for a change that should apply everywhere. When you want one component to differ, add a rule for its class in the same config, and it is emitted into your stylesheet:

styleframe.config.ts
s.selector(".button", {
  fontWeight: "600",
  letterSpacing: "0.01em",
});
.button {
  font-weight: 600;
  letter-spacing: 0.01em;
}

This is how Inkline styles its own components internally. Each one pairs its markup with a styleframe file that layers project-specific rules on top of the shared recipe — the Button, for example, adds its full-width modifier and its loading spinner this way:

import { useButtonRecipe } from "@styleframe/theme";

s.selector(".button--block", { width: "100%" });

s.keyframes("button-spin", { "100%": { transform: "rotate(360deg)" } });

export const buttonRecipe = useButtonRecipe(s);

Because your rules and Inkline's are compiled by the same tool into the same stylesheet, you are extending the system rather than fighting it with specificity.

When tokens are not enough

If your design shares nothing with the default components — different markup, different structure, not just different colors — do not theme your way there. Use the headless components instead and bring your own CSS entirely. See Your first component.

Next steps

Copyright © 2026