跳到主要内容

主题

所有视觉 token 都是声明在 :root 上的 CSS 自定义属性,带合理默认值。只覆盖你想 改的——不需要 theme 对象,也不需要构建步骤。

覆盖变量

:root {
--rios-color-text: #1d2038;
--rios-color-accent: #0a84ff; /* iOS 蓝:确认按钮 + 对勾 */
--rios-color-selected: #0a84ff; /* 选中行文字 */
--rios-color-hairline: rgba(60, 60, 67, 0.29);
--rios-font-size-body: 17px;
--rios-row-height: 58px;
--rios-easing-spring: cubic-bezier(0.32, 0.72, 0, 1);
}

也可以把覆盖限定到某个子树——例如包住一个 select 给它紫色强调色,不动 app 其余 部分:

<div style={{ "--rios-color-accent": "#7c3aed", "--rios-color-selected": "#7c3aed" }}>
<Select multiple value={v} onValueChange={setV} options={options} />
</div>

完整变量参考

变量默认值用途
--rios-color-text#1d2038触发器 + sheet 文字
--rios-color-muted#7b8190占位符、描述
--rios-color-linergba(26,34,56,.1)边框
--rios-color-accent#0a84ffiOS 蓝:确认按钮、对勾填充
--rios-color-selected#0a84ff选中行文字
--rios-color-trigger-bg#fcfbf8触发器背景
--rios-color-sheet-bg#f7f7f9sheet 背景
--rios-color-row-activergba(0,0,0,.035)移动行按下反馈
--rios-color-hairlinergba(60,60,67,.29)iOS 分隔线
--rios-shadow-sheet0 18px 70px rgba(15,23,42,.28)sheet 阴影
--rios-radius-sheet32pxsheet 圆角
--rios-radius-trigger18px触发器圆角
--rios-font-size-body17px选项 label 字号
--rios-font-size-description13px描述字号
--rios-row-height58px选项行高(~44pt)
--rios-hairline-inset16px分隔线左缩进
--rios-easing-springcubic-bezier(.32,.72,0,1)iOS 弹簧曲线
--rios-check-size22px实心对勾直径

类名

所有内置类都带 rios- 前缀(如 rios-triggerrios-sheetrios-option-row)。高级覆盖时可在自己的 CSS 里直接定位它们。通过 className prop 给触发器加额外类。

警告

data-rios-* 属性和 rios-* 类名是公开 API——重命名或删除属于破坏性变更, 需要升大版本。见 data 属性