Skip to content
arviahqPublic

About

Design tokens → variants → slots → theme modes, in one language. Compiles to optimized CSS + fully-typed. Nothing ships at runtime.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Repository files navigation

Arvia — The CSS you already love, supercharged

The CSS you already love — supercharged.
Variants, slots, tokens, and theming. Compiles to plain CSS and typed APIs with zero runtime.

Docs · Playground · Quick start


Arvia

Write styles in .arv files — ordinary modules you import like any other — and Arvia turns them into hashed CSS plus a small typed export. Nothing styling-related runs in the browser.

import { color, space } from "./theme.arv"

component Button {
  base {
    display: inline-flex
    padding: space.2 space.4
    border-radius: radius.md
    background: color.primary
    color: white
    border: none
    cursor: pointer
  }

  variant tone: primary {
    primary { background: color.primary }
    danger { background: color.danger }
  }

  variant size: sm {
    sm { font-size: font.sm; padding: space.1 space.3 }
    lg { font-size: font.lg; padding: space.3 space.5 }
  }
}
import { Button } from "./button.arv";

const styles = Button({ tone: "danger", size: "lg" });

export function DeleteButton() {
  return <button className={styles.root}>Delete</button>;
}

Why Arvia

  • Language, not a JS API — tokens, variants, slots, when compounds, and CSS nesting read like CSS with structure.
  • Compile-time only — every class name and rule exists before your app starts.
  • Framework-agnostic — plain class / className / :class consumers; React, Preact, Vue, or anything else.
  • Typed by default — variant props and slot maps typecheck in the editor.

Install

Pick the Vite entrypoint for your framework (plugin + CLI + TypeScript wiring):

React

npm install -D @arviahq/vite-plugin-react
// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { arvia } from "@arviahq/vite-plugin-react";

export default defineConfig({
  plugins: [arvia(), react()],
});

Preact

npm install -D @arviahq/vite-plugin-preact @preact/preset-vite preact
// vite.config.ts
import { defineConfig } from "vite";
import preact from "@preact/preset-vite";
import { arvia } from "@arviahq/vite-plugin-preact";

export default defineConfig({
  plugins: [arvia(), preact()],
});

Vue

npm install -D @arviahq/vite-plugin-vue @vitejs/plugin-vue vue
// vite.config.ts
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { arvia } from "@arviahq/vite-plugin-vue";

export default defineConfig({
  plugins: [arvia(), vue()],
});

Use arvia-tsc (shipped with the Vue plugin) instead of vue-tsc so .arv imports inside SFCs typecheck.

Other frameworks

@arviahq/vite-plugin is the framework-agnostic core. Pair it with Svelte, Solid, Lit, or server-rendered templates.

Full setup: arvia.dev/docs/quick-start.

Language snapshot

Construct What it does
token Named value groups (color.primary, space.4); optional modes + @dark
style One exported class; composes inlines another style
component Slots + variant axis: default { … } + when compounds
contract / theme … implements Typed, coexisting skins
keyframes / global / raw Motion, document CSS, and escape hatches

Coming from 0.x? See Coming from Arvia 0.x — recipe / use, defaults { }, and ambient theme { } are gone.

Documentation & playground

pnpm install
pnpm website

Open localhost:5173 — or use the live site at arvia.dev (docs + interactive playground).

Editor support

Packages

Package Install? Purpose
@arviahq/vite-plugin-react yes React + Vite entrypoint
@arviahq/vite-plugin-preact yes Preact + Vite entrypoint
@arviahq/vite-plugin-vue yes Vue + Vite entrypoint (+ Vue-aware arvia-tsc)
@arviahq/vite-plugin agnostic Core Vite plugin + arvia CLI
@arviahq/typescript-plugin tsserver plugin + arvia-tsc
@arviahq/compiler Core compiler
@arviahq/runtime Shared recipe helpers for large components
@arviahq/language-server LSP for .arv
@arviahq/storybook Storybook story generator
@arviahq/docs Token catalog generator
VS Code extension marketplace Highlighting, diagnostics, completion

Development

pnpm install
pnpm build
pnpm test

Local playground: examples/demo. Releases: PUBLISHING.md.

Acknowledgements

Arvia owes a great deal to vanilla-extract — build-time CSS, typed themes, and the recipes/variants mental model inspired the language.

License

MIT

About

Design tokens → variants → slots → theme modes, in one language. Compiles to optimized CSS + fully-typed. Nothing ships at runtime.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages