verstak
Version:
Verstak - Front-End Library
15 lines (14 loc) • 458 B
JavaScript
import { Mode, ReactiveNode } from "reactronic";
import { Division } from "verstak";
import { Theme } from "./Theme.js";
export function Icon(name, declaration) {
return (Division(ReactiveNode.withBasis(declaration, {
mode: Mode.autonomous,
triggers: { name },
script: el => {
const theme = Theme.current.icon;
el.useStylingPreset(name);
el.useStylingPreset(theme.main);
},
})));
}