Public beta: 1.0.0-beta.0

Three brand colours in. One tiny stylesheet out.

Cortex turns your brand colours into every design token a product needs, as plain CSS variables. No framework, no runtime.

Get started npm install @flexpixels/cortex@beta

The light on this page is your theme. Change a colour.

6.7 KB gzipped · 599 tokens · light and dark

Your three colours

What Cortex generates from them

primary
secondary
neutral
success
warning
danger
info
surfaces app subtle element overlay inverse

Seven colour roles, twelve steps each. Success, warning, danger and info are derived unless you set them. The surfaces are the page, a recessed band, a raised card, a menu, and a tooltip in the other scheme’s colours.

Rendered with those tokens

Release checklist

Three tasks left before Friday.

PublishView tasks
  • Button label 6.3:1
  • Body text 14.1:1
  • Muted text 8.1:1
  • Brand text 5.5:1

A config file and one call.

Name three colours. One function returns the stylesheet as a string, in Node, in Bun or in the browser.

theme-config.json
{
  "seeds": {
    "primary":   "#4f46e5",
    "secondary": "#7c3aed",
    "neutral":   "#334155"
  }
}

These are the colours in the panel above.

build.js
import { generateThemeCSS, loadUserConfig }
  from "@flexpixels/cortex";

const css = generateThemeCSS(loadUserConfig());

Write the string to a file in a build script, or run it in CI.

Small, plain, and checked before it ships.

Everything below is measured from the stylesheet this page is wearing.

The default stylesheet, light and dark, is 6.7 KB on the wire.

That is every colour ramp, and the type, spacing, radius, elevation and motion tokens a page uses; output.tokens: "full" writes every token. The bars are drawn to scale.

49,853 bytes unpacked
6,906 bytes gzipped

The output is plain CSS variables.

Use them from any stylesheet, in any framework, or in none.

.button {
  background: var(--fp-primary-9);
  color: var(--fp-primary-9-contrast);
}
PublishThat rule, rendered.

Text contrast is solved first.

Each text colour is chosen against the surface it sits on, to WCAG AA, before the file is written.

  • Button label 6.3:1
  • Body text 14.1:1
  • Muted text 8.1:1
  • Brand text 5.5:1

Light and dark come from the same file.

One set of variables. The browser picks the scheme, so there is nothing to switch in JavaScript.

light
dark

Sixteen tools for your coding agent.

The same engine as an MCP server. An agent can make a theme, check it and export it, and gets measured answers back.

@flexpixels/cortex-mcp
  • Your agent
  • cortex-mcp16 tools
  • Generate
  • Validate
  • Check contrast
  • Export DTCG
  • Export DESIGN.md

Install it and name three colours.

npm install @flexpixels/cortex@beta Read the quick start Open the configurator