Plumeria logoPlumeria

zss-engine

zss-engine is the public runtime API for Plumeria.
Use this to build zero-runtime CSS-in-JS libraries on top of the same StyleSheet engine.

Installation

Terminal
npm i zss-engine
Terminal
yarn add zss-engine
Terminal
pnpm i zss-engine

Overview

TypeScript
export type { CSSProperties } from './types/css-properties.js';
export { genBase36Hash } from './utils/hash.js';
export { transpile } from './utils/transpile.js';
export { transpileAtomic } from './utils/transpile-atomic.js';
export { splitAtomicAndNested, processAtomicProps } from './utils/processor-atomic.js';
export { overrideLonghand } from './utils/override-longhand.js';
export { camelToKebabCase, applyCssValue, exceptionCamelCase } from './utils/helper.js';

Functions

genBase36Hash

Arguments: object, number of hash lengths
Returns: string of hash

TypeScript
const base36Hash = genBase36Hash(object, 6); 

transpiler

Argments: object: style object, hash: string
Returns: styleSheet: string

TypeScript
const { styleSheet } = transpiler(object, base36Hash);

transpilerAtomic

Argments: object: style object, value: string | number, hash: string
Returns: styleSheet: string

TypeScript
const { styleSheet } = transpilerAtomic(object, property, atomichash);

Types

TypeScript
const styles: Record<string, CSSProperties>

On this page