配置提供者组件用于全局配置主题和样式变量。
# 基本用法
复制代码
# 属性说明
| 属性 | 类型 | 默认值 | 可选值 | 说明 |
|---|---|---|---|---|
primaryColor | String | - | - | 自定义主题色 |
theme | String | - | dark、light | 主题模式 |
size | String | - | small、medium、large | 组件尺寸 |
injectBackground | Boolean | - | - | 是否注入背景色到根元素 |
injectColor | Boolean | - | - | 是否注入文字颜色到根元素 |
tag | String | 'div' | - | 根元素标签 |
proxyElement | HTMLElement / String | - | - | 代理元素 |
vars | Object | - | - | 自定义 CSS 变量 |
# 示例
# 自定义主题色
复制代码
# 亮色主题
复制代码
# 自定义 CSS 变量
复制代码
# 组合配置
复制代码
# 动态主题切换
复制代码
# 支持的 CSS 变量
| CSS 变量 | 说明 |
|---|---|
--xt-color-primary | 主色 |
--xt-color-success | 成功色 |
--xt-color-warning | 警告色 |
--xt-color-danger | 危险色 |
--xt-color-info | 信息色 |
--xt-text-color-primary | 主要文字颜色 |
--xt-text-color-regular | 常规文字颜色 |
--xt-text-color-secondary | 次要文字颜色 |
--xt-bg-color | 背景颜色 |
--xt-bg-color-page | 页面背景颜色 |
--xt-border-color | 边框颜色 |
--xt-flex-box-gap | FlexBox 默认间距 |