跳到主要内容

Function: configToCssVars()

configToCssVars(c?, opts?): CSSProperties

Defined in: theme.ts:71

合并默认值并把配置展平为 CSS 变量对象(可直接放进 React style, 亦可用作 LayoutProvider 的注入源)。 CSS 自定义属性不在 CSSProperties 已知键集合内,此处做唯一一次断言, 消费方无需再各自 as。

Parameters

c?

LayoutConfig

部分覆盖的配置;缺省项回退默认值

opts?

partial?

boolean

只输出显式配置的键(不补默认)。LayoutViewDom 实例级用它, 让 LayoutProvider 的全局变量穿透实例内联样式;非 partial 保持原语义(零回归)

Returns

CSSProperties

--tl-* CSS 变量样式的 React style 对象