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
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.
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.
What it does.
- 01
Class, primitive, descendant, and interaction-state selectors
- 02
Global design tokens and component-scoped variables
- 03
A deliberate two-layer cascade without specificity surprises
- 04
Backend-neutral resolved-style output
- 05
Runtime loading designed for styling without a rebuild
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.
