csscodec
v0.1.0
Published
Encode portable Mosa layout and style structures as CSS and decode supported CSS values.
Readme
csscodec
Encode portable Mosa layout and style structures as CSS and decode supported CSS values.
csscodec is a small, deterministic codec for CSS declarations and supported style metadata from portable Mosa layout structures. It does not require a browser DOM or a CSS engine.
Install
npm i csscodec layoutmodelimport { encodeCss } from "csscodec";
const css = encodeCss(".card", {
display: "grid",
gap: 16,
opacity: 0.9,
});Architecture
@mosanic/theme ─┐
layoutmodel ────┼──→ csscodec ↔ CSS
style metadata ─┘The codec owns CSS representation; layout trees, themes, and application styling remain portable inputs owned by their respective packages.
MIT.
