Public
Edited
Jan 14, 2023
Insert cell
Insert cell
tw = await import("https://cdn.skypack.dev/twind").then((m) => {
let util = m.create({ preflight: false });
let styles;

return (...tokens) => {
util.tw(({ css }) => {
styles = css(...tokens);
styles._ = undefined;
return "";
});

return styles;
};
})
Insert cell
viewof str = Inputs.text()
Insert cell
Object.entries(tw(str))
.map(([k, v]) => {
if (typeof v === "object") {
v = Object.entries(v).map((d) => d[0] + ": " + d[1] + ";");
return k + "{\n" + v + "\n}\n";
}
return k + ": " + v + ";";
})
.join("\n")
Insert cell
tw(str)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more