Editor
Write full HTML here (tags + text + classes). Chips apply to the root element.
Root element classes
Runtime Style Orchestrator
kw- prefix enforcement for clean scopekw-w-[320px]kw-w-1/2data-kahwa-classes1. Boot + DOM Ready Handshake
initKahwaCSS() waits for DOM readiness, then
starts the first scan and observer.
2. Config Resolution + Prefix Lock
User config is merged with defaults; the engine intentionally
supports only kw- utilities.
3. DOM Scan by Utility Selector
scanDOM() finds matching nodes using
[class*="kw-"] and runs style application on each.
4. Safe Apply + Class Cache
applyStyles() skips unsafe tags
(script/style/noscript) and stores applied tokens
in data-kahwa-classes to avoid redundant work.
5. Token Parsing + Value Resolution
Tokens are parsed by static maps and regex rules, including spacing scale, fractions, color tokens, and arbitrary bracket values.
6. Live Mutation Sync
A MutationObserver watches new nodes and class
changes, batches updates with
requestAnimationFrame, and reapplies styles.
Type your kw- classes or click class chips to style the
live component.
Editor
Write full HTML here (tags + text + classes). Chips apply to the root element.
Root element classes
Preview