Skip to content

pantoken / renderers/bootstrap/src / toBootstrapCss

函数: toBootstrapCss()

toBootstrapCss(options?): string

实验性

输出 Bootstrap → Instructure 的 CSS 变量桥接。

参数

options?

ToBootstrapCssOptions = {}

ToBootstrapCssOptions.

返回值

string

桥接用的 CSS 字符串。

示例

默认 :root 桥接

ts
import { toBootstrapCss } from "@pantoken/bootstrap";

const css = toBootstrapCss();
// ":root { --bs-primary: var(--instui-color-background-brand); … }"

限定到 Bootstrap 的 theme 属性

ts
import { toBootstrapCss } from "@pantoken/bootstrap";

const css = toBootstrapCss({ selector: "[data-bs-theme]" });