← In development
10 / Stylesheet language

Cosmos

Cosmos is the appearance layer for Chaos components. It keeps color, layout, interaction states, design tokens, and transitions outside component behavior, producing a generic resolved style that rendering backends can apply.

Technology
C++20 / Language tooling
Status
Prototype implemented
The challenge

Game UI needs fast styling without a browser engine.

Game UI needs the iteration speed and familiarity of web styling without inheriting the full complexity of a browser. Styles must remain strict, component-aware, hot-reloadable, and independent of whichever widget or rendering backend consumes them.

The approach

Borrow the useful parts of CSS and stop there.

The implemented Lustre prototype validates the core model: tokenize and parse a CSS-like language, resolve variables and a two-layer cascade, enforce component boundaries, and emit backend-neutral style data. Cosmos carries that work into the Nyx and Chaos naming and file model.

Inside the project

What it does.

  1. 01

    Class, primitive, descendant, and interaction-state selectors

  2. 02

    Global design tokens and component-scoped variables

  3. 03

    A deliberate two-layer cascade without specificity surprises

  4. 04

    Backend-neutral resolved-style output

  5. 05

    Runtime loading designed for styling without a rebuild

Design principles

How decisions
get made.

Familiar, not identical

CSS concepts are reused where they help, without attempting to recreate a browser layout engine.

Appearance only

Logic and data binding stay in Nyx; Cosmos decides only how a component looks.

Strict boundaries

Component styles cannot reach through child components, while global styles remain deliberately global.

See the work

Cosmos

Follow the prototype
Next projectCrimson & Thorn