Skip to content

Stylesheet

Create inline styles in JS/TS with Protection Levels.

Pages

Quick Start

ts
import { InlineStyle, StyleSheet } from "@briklab/lib/stylesheet";

const style = new InlineStyle({ color: "red", fontSize: "16px" }, "boundary");
style.addStyleWithObject({ backgroundColor: "blue" }).removeStyle("fontSize").applyTo(document.getElementById("myElement"));

const sheet = new StyleSheet();
sheet.set(".title", new InlineStyle({ fontWeight: "bold" }));
console.log(sheet.generate());