npm.io
0.2.0 • Published 19h ago

@animus-ui/core

Licence
MIT
Version
0.2.0
Deps
0
Vulns
0
Weekly
0
Stars
8

@animus-ui/core

The framework-neutral half of Animus: tokens and themes, the system builder, the cascade-ordered style chain, prop groups, and class resolution. It imports no UI framework. Styles extract to static CSS at build time.

Most projects install a binding, which builds on this package:

Use this package directly where no binding fits, such as Svelte or plain templates: define styles with .asClass() and resolve class names at runtime with @animus-ui/core/class-resolver.

Install

npm install @animus-ui/core

Pair with an extraction driver: @animus-ui/vite-plugin, @animus-ui/next-plugin, @animus-ui/unplugin, or the @animus-ui/cli.

Exports

Path What it holds
@animus-ui/core createTheme, createSystem, the style chain ending in .asClass(), types
@animus-ui/core/groups Pre-built prop groups: space, color, typography, layout, and more
@animus-ui/core/class-resolver createClassResolver: class resolution with no component runtime
@animus-ui/core/runtime For binding packages: what a component runtime imports, without the builder
@animus-ui/core/binding For binding packages: the chain's runtime class and its config helpers
@animus-ui/core/appearance The stored color-mode record and its write path
@animus-ui/core/appearance/controller createColorModeController
@animus-ui/core/appearance/svelte colorModeStore: the controller as a Svelte store
@animus-ui/core/bootstrap createAppearanceBootstrap: build-time only

Writing a binding

A binding adds its terminals to the chain and inherits every earlier step. It registers one key on ChainTerminals by module augmentation, then names its chain root as ChainRoot<'its-key', PropRegistry, GroupRegistry>. At runtime it subclasses AnimusChain, from @animus-ui/core/binding, and its component runtime imports only @animus-ui/core/runtime. @animus-ui/react is the reference.

Keywords