跳转到内容

QuestionFlow 澄清问卷 alpha

执行前先提问:一次一题,逐题作答,答完一起提交。

用法

一次一题:单选选中后自动进入下一题,多选等待用户点击继续,末题的按钮变为发送

这次改动动到哪一层?

Question 1 of 3

组件结构

加粗的是必需部件。

data-scope="question-flow"root · viewport · track · question · prompt · group · item · item-indicator · item-text · note · footer · prev-trigger · counter · next-trigger · skip-trigger · submit-trigger · result · live-region

示例

自由文本与跳过

选项之外还可自行填写一句,填写后即视为已作答;关闭自动前进,每题都等待用户点击继续

文案用什么口吻?

Question 1 of 2

受控当前题

进度由宿主管理:外部按钮直接跳题,答案也一并受控,组件只发意图

先修哪一处?

Question 1 of 2

宿主手上的进度:第 1 题;已答 0 题

尺寸

size 改变问句、选项行与页脚按钮的几何档,三档共用同一份问题

这次改动动到哪一层?(sm)

这次改动动到哪一层?(md)

这次改动动到哪一层?(lg)

设计指引

何时使用

  • 需求尚有几处不明确,把含糊的地方拆成几道选择题。
  • 一次需要问多件事,且每件都只需一两秒作答。

何时不用

  • 只问一件事时,使用单选组复选框组,不需要套一层问卷。
  • 需要用户批准一次危险操作时,使用审批:它的出口只有批准与拒绝,没有“跳过”,也没有“答完再说”。
  • 收集一份长表单时,字段之间有校验与联动,使用表单

特性

  • 一次只暴露一题:非当前题对读屏 aria-hidden、对键盘 inert,其中的可聚焦元素另发 tabindex="-1"。它们仍留在轨道上,只是不可到达,这样卡片高度可以测量,来回翻页也不需要重建 DOM。
  • 高度与位移是测量得出的:状态机在活动 DOM 上测量当前题的盒,把结果写入 context,连接层只把它格式化为两个私有槽(视口高度与轨道位移)。连接层是渲染期纯函数,不查询 DOM、不启动定时器、不读取时钟。
  • 单选自动前进,多选等待用户点击继续:选中一项后隔一小段自动翻到下一题;连续更改时,每次更改都从整段延时重新计时。自动前进只走到下一题,末题上停止,不替用户提交。
  • 一个按钮两个身份:不是末题时为“继续”,末题时为“发送”。它原位切换 data-mode 与可访问名称,正在按它的用户不会按空。
  • 自由文本与选项同等有效:填写了“都不是,我想要……”即视为已作答,继续键随之可用。
  • 进度只播报一次:counter 部件 aria-hidden,逐题跳动的数字不进入活动区域;换题与提交由 announcement 读出一句。
  • 跳过是明确路径:allowSkip 关闭时整个跳过键收起,而不是保留一个不可用的按钮。末题上跳过即提交,否则最后一题没有出口。

组合

  • 步进计数器需要做成逐位滚动时,把 counter 作为容器,数字交给数值动画,判定权仍在本组件。
  • 问卷提交后需要执行危险操作时,把审批排在它后面,两件事分开:问卷收集的是“怎么做”,闸门收集的是“做不做”。
  • 放入对话框时把 initialFocus 指向当前题的第一个选项,打开即可用方向键作答。

最佳实践

  • 题目控制在三到五道:这是执行前的澄清,不是问卷调查。
  • 单选题的选项写成互斥的完整答案,不依赖自由文本补充关键信息。
  • 提交之后卡片不会自动消失:宿主需要在 onSubmit 中决定后续动作,需要保留时渲染 result 部件。

反模式

  • 用它承载不可逆的动作确认:问卷没有“拒绝”路径,跳过与不答都会让流程继续。
  • counter 的文字当作播报:该部件对读屏隐藏,修改它不会被读出。
  • 关闭自动前进的同时隐藏继续键:单选题将没有出口。

API 参考

产物

自定义元素<xh-question-flow>
Vue 组件XhQuestionFlowCounter XhQuestionFlowFooter XhQuestionFlowGroup XhQuestionFlowItem XhQuestionFlowItemIndicator XhQuestionFlowItemText XhQuestionFlowLiveRegion XhQuestionFlowNextTrigger XhQuestionFlowNote XhQuestionFlowPrevTrigger XhQuestionFlowPrompt XhQuestionFlowQuestion XhQuestionFlowResult XhQuestionFlowRoot XhQuestionFlowSkipTrigger XhQuestionFlowSubmitTrigger XhQuestionFlowTrack XhQuestionFlowViewport
组合式函数useQuestionFlow
状态机questionFlowMachine
皮肤@xihan-ui/styles/question-flow.css

Props

属性类型必填说明
questionsreadonly QuestionFlowQuestion[]
indexnumber当前题下标。提供即受控:内部不再自行修改,只发 onIndexChange。
defaultIndexnumber
answersQuestionFlowAnswers答案表。提供即受控。
defaultAnswersQuestionFlowAnswers
notesQuestionFlowNotes自由文本表。提供即受控。
defaultNotesQuestionFlowNotes
statusQuestionFlowStatus答题状态。提供即受控。
defaultStatusQuestionFlowStatus
autoAdvanceboolean单选选中后自动进入下一题,默认开启。 它只进入下一题,末题上不会替用户提交。
autoAdvanceDelaynumber自动前进前等待的时长(毫秒),默认 480。非有限值或负数不启动计时器。
allowSkipboolean允许跳过,默认开启。关闭后跳过按钮收起,SKIP 事件也不再生效。
loopboolean选项组内漫游到达末尾是否回绕,默认 true。
variantControlVariant形态:outline 描边、subtle 底色分区、ghost 无壳内联。默认 outline。
toneTone
sizeSize
translationsPartial<QuestionFlowTranslations>
onIndexChange(details: QuestionFlowIndexChangeDetails) => void
onAnswersChange(details: QuestionFlowAnswersChangeDetails) => void
onNotesChange(details: QuestionFlowNotesChangeDetails) => void
onSkip(details: QuestionFlowSkipDetails) => void
onSubmit(details: QuestionFlowSubmitDetails) => void

事件

自定义元素将载荷放在 detail;Vue 使用同名 emit。

事件载荷说明
index-changeQuestionFlowIndexChangeDetails当前题变化;detail 为 { index }
answers-changeQuestionFlowAnswersChangeDetails答案变化;detail 为 { answers }
notes-changeQuestionFlowNotesChangeDetails自由文本变化;detail 为 { notes }
skipQuestionFlowSkipDetails跳过一题;detail 为 { index, questionId }
submitQuestionFlowSubmitDetails交卷;detail 为 { answers, notes }

插槽

仅列出带载荷的插槽。

Vue 组件插槽载荷说明
XhQuestionFlowItemdefaultQuestionFlowOptionSlotProps
XhQuestionFlowRootdefaultQuestionFlowRootSlotProps

状态

公开状态写入 data-state

部件取值
root'answering' | 'submitted'
item'checked' | 'unchecked'
item-indicator'checked' | 'unchecked'
item-text'checked' | 'unchecked'
result'answering' | 'submitted'

以下名称仅用于内部状态机。

状态answering · submitted

事件OPTION.TOGGLE · NOTE.SET · GOTO · NEXT · PREV · SKIP · SUBMIT · VIEWPORT.MEASURE · after.autoAdvance · CONTROLLED.ANSWERING · CONTROLLED.SUBMITTED · PRESS.START · PRESS.END

判据isStatusControlled · canToggle · canSkip · isFirstQuestion · isLastQuestion · canPress

connect API

getXxxProps() 返回对应部件的宿主属性。

成员类型说明
statusQuestionFlowStatus
submittedboolean已提交。
indexnumber夹到题数范围内的当前题下标。
countnumber题数。
currentQuestionFlowQuestion | undefined当前题;没有题目时为 undefined。
isFirstboolean
isLastboolean
canAdvanceboolean当前题是否可以进入下一题:已选选项、已填自由文本,或该题本身可跳过。
allowSkipboolean
counterstring视觉上的 N / M。它对读屏隐藏,进度由播报区朗读。
announcementstring读屏朗读的语句:答题中朗读进度,提交后朗读结果。
answersQuestionFlowAnswers
notesQuestionFlowNotes
answersOf(questionId: string) => readonly string[]
noteOf(questionId: string) => string
isOptionSelected(questionId: string, value: string) => boolean
isCurrent(questionId: string) => boolean
goTo(index: number) => void
next() => void
prev() => void
skip() => void
submit() => void
toggleOption(questionId: string, value: string) => void
setNote(questionId: string, value: string) => void
measure() => void重新测量当前题的几何。换题与题目增删都会自动重新测量,容器尺寸变化由尺寸观察器接管。
getRootProps() => T['element']
getViewportProps() => T['element']
getTrackProps() => T['element']
getQuestionProps(props: QuestionFlowQuestionProps) => T['element']
getPromptProps(props: QuestionFlowQuestionProps) => T['element']
getGroupProps(props: QuestionFlowQuestionProps) => T['element']
getItemProps(props: QuestionFlowItemProps) => T['button']
getItemIndicatorProps(props: QuestionFlowItemProps) => T['element']
getItemTextProps(props: QuestionFlowItemProps) => T['element']
getNoteProps(props: QuestionFlowQuestionProps) => T['input']
getFooterProps() => T['element']
getPrevTriggerProps() => T['button']
getCounterProps() => T['element']
getNextTriggerProps() => T['button']
getSkipTriggerProps() => T['button']
getSubmitTriggerProps() => T['button']
getResultProps() => T['element']
getLiveRegionProps() => T['element']

无障碍

键盘

规格出处:W3C APG

按键生效条件行为
ArrowDown / ArrowRight焦点在当前题的选项上焦点移到下一个可停留选项(禁用项跳过、尽头按 loop 回绕);单选时同时选中它
ArrowUp / ArrowLeft焦点在当前题的选项上焦点移到上一个可停留选项;单选时同时选中它
Home焦点在当前题的选项上焦点移到首个可停留选项;单选时同时选中它
End焦点在当前题的选项上焦点移到末个可停留选项;单选时同时选中它
Space焦点在当前题的选项上切换该项。单选点已选中的那一项不取消
Enter焦点在当前题的选项或自由文本上,且这一题答得能往下走前进一题;已经在末题就交卷
Space按住当前题的未禁用选项按住期间该选项投影 data-pressed,与指针 :active 同一副按压面(row 档只换面不缩放);抬起、失焦、换题或交卷撤下。Enter 不是选项的激活键,不进按压面
Enter / Space按住未禁用的上一题 / 下一题 / 跳过 / 继续(发送)按钮按住期间该按钮投影 data-pressed,与指针 :active 同一副按压面;抬起、失焦、换题或交卷撤下

ARIA

以下属性由 connect 生成。

部件属性
questionaria-hiddenundefined | 'true'
questionaria-labelundefined | translations?.prompt
questionaria-labelledbyprompt 部件的 id | undefined
questionrole'group'
grouparia-labelundefined | translations?.options
grouparia-labelledbyprompt 部件的 id | undefined
grouprole'radiogroup' | 'group'
itemaria-checked'true' | 'false'
itemaria-disabled'true' | 'false'
itemrole'radio' | 'checkbox'
item-indicatoraria-hidden'true'
notearia-labeltranslations?.note
prev-triggeraria-labeltranslations?.prev
counteraria-hidden'true'
next-triggeraria-labeltranslations?.next
skip-triggeraria-labeltranslations?.skip
submit-triggeraria-labeltranslations?.send | translations?.continue
resultaria-hidden'true'
live-regionaria-atomic'true'
live-regionaria-live'polite'
  • 每题是 role=group,题干是它的可访问名称;题干缺席时退到 translations.prompt
  • 选项组按题型取 role=radiogroup(单选)或 role=group(多选),同样由题干命名;选项各自是 role=radiorole=checkbox 并显式报告 aria-checked
  • 选项组内是漫游焦点:整组只占一个 Tab 位,落在选中项上,没有选中时落在首个可停留项。
  • 上一题 / 下一题只提供按钮入口,不接管全局按键,避免与选项漫游争抢方向键。这两个按钮通常只绘制箭头,因此它们的可访问名称始终发出(translations.prev / translations.next,默认 Previous question / Next question);跳过键一般带可见文字,未提供 translations.skip 时不产出 aria-label
  • 自由文本取 translations.note 作为可访问名称(默认 Other answer),占位文字取 translations.notePlaceholder
  • 备注框与选项组都处理输入法组合态:组合期间的 Enter 用于确认候选词,不前进。

样式参考

皮肤

@xihan-ui/styles/question-flow.css 使用 [data-scope="question-flow"][data-part="root"] 部件选择器,位于 xihan.componentsxihan.motion 层。覆盖样式使用 xihan.overrides

数据属性

connect 生成;条件不成立时不输出无值属性。

部件属性
rootdata-sizeprops.size
rootdata-state'answering' | 'submitted'
rootdata-toneprops.tone
rootdata-variantprops.variant
questiondata-current''(条件成立时才出现)
groupdata-select-mode'single' | 'multiple'
itemdata-disabled''(条件成立时才出现)
itemdata-pressed''(条件成立时才出现)
itemdata-select-mode'single' | 'multiple'
itemdata-state'checked' | 'unchecked'
itemdata-xh-action-control''
itemdata-xh-action-display'always'
itemdata-xh-action-profile'row'
itemdata-xh-action-sizeprops.size
itemdata-xh-action-variant'ghost'
item-indicatordata-select-mode'single' | 'multiple'
item-indicatordata-state'checked' | 'unchecked'
item-textdata-state'checked' | 'unchecked'
item-textdata-valueitem.value
prev-triggerdata-disabled''(条件成立时才出现)
prev-triggerdata-pressed''(条件成立时才出现)
prev-triggerdata-xh-action-control''
prev-triggerdata-xh-action-display'always'
prev-triggerdata-xh-action-profile'icon'
prev-triggerdata-xh-action-size'xs'
prev-triggerdata-xh-action-variant'ghost'
next-triggerdata-disabled''(条件成立时才出现)
next-triggerdata-pressed''(条件成立时才出现)
next-triggerdata-xh-action-control''
next-triggerdata-xh-action-display'always'
next-triggerdata-xh-action-profile'icon'
next-triggerdata-xh-action-size'xs'
next-triggerdata-xh-action-variant'ghost'
skip-triggerdata-disabled''(条件成立时才出现)
skip-triggerdata-pressed''(条件成立时才出现)
skip-triggerdata-xh-action-control''
skip-triggerdata-xh-action-display'always'
skip-triggerdata-xh-action-profile'text'
skip-triggerdata-xh-action-sizeprops.size
skip-triggerdata-xh-action-variant'ghost'
submit-triggerdata-disabled''(条件成立时才出现)
submit-triggerdata-mode'send' | 'continue'
submit-triggerdata-pressed''(条件成立时才出现)
submit-triggerdata-toneprops.tone
submit-triggerdata-xh-action-control''
submit-triggerdata-xh-action-display'always'
submit-triggerdata-xh-action-profile'text'
submit-triggerdata-xh-action-sizeprops.size
submit-triggerdata-xh-action-variant'solid'
resultdata-state'answering' | 'submitted'

CSS 变量

本组件公开覆盖槽由独立皮肤的实际消费位生成;默认来源、作用部件和状态均与 CSS 同源。

变量部件CSS 属性状态默认来源说明
--xh-question-flow-action-font-sizeskip-trigger
submit-trigger
font-sizedefault--xh-text-label-sizequestion-flow 的 skip-trigger、submit-trigger 部件 font-size 覆盖槽。
--xh-question-flow-action-font-weightskip-trigger
submit-trigger
font-weightdefault--xh-text-label-weightquestion-flow 的 skip-trigger、submit-trigger 部件 font-weight 覆盖槽。
--xh-question-flow-action-gapskip-trigger
submit-trigger
gapdefault--xh-space-1question-flow 的 skip-trigger、submit-trigger 部件 gap 覆盖槽。
--xh-question-flow-action-hskip-trigger
submit-trigger
block-size
inline-size
min-block-size
default
xh-action-profile=icon
xh-action-profile=row
--xh-_question-flow-hquestion-flow 的 skip-trigger、submit-trigger 部件 block-size、inline-size、min-block-size 覆盖槽。
--xh-question-flow-action-pxskip-trigger
submit-trigger
padding-inlinedefault--xh-_question-flow-pxquestion-flow 的 skip-trigger、submit-trigger 部件 padding-inline 覆盖槽。
--xh-question-flow-action-radiusskip-trigger
submit-trigger
border-radiusdefault--xh-shape-controlquestion-flow 的 skip-trigger、submit-trigger 部件 border-radius 覆盖槽。
--xh-question-flow-bgrootbackgrounddefault
variant=subtle
--xh-_tone-subtle
--xh-bg-surface
question-flow 的 root 部件 background 覆盖槽。
--xh-question-flow-borderrootborderdefault--xh-border-defaultquestion-flow 的 root 部件 border 覆盖槽。
--xh-question-flow-counter-fgcountercolordefault--xh-fg-subtlequestion-flow 的 counter 部件 color 覆盖槽。
--xh-question-flow-counter-font-sizecounterfont-sizedefault--xh-text-caption-sizequestion-flow 的 counter 部件 font-size 覆盖槽。
--xh-question-flow-dot-radiusitem-indicatorborder-radiusempty
select-mode=single
--xh-shape-circlequestion-flow 的 item-indicator 部件 border-radius 覆盖槽。
--xh-question-flow-dot-sizeitem-indicatorblock-size
inline-size
empty
select-mode=single
--xh-question-flow-indicator-sizequestion-flow 的 item-indicator 部件 block-size、inline-size 覆盖槽。
--xh-question-flow-footer-gapfootergapdefault--xh-space-3question-flow 的 footer 部件 gap 覆盖槽。
--xh-question-flow-gaprootgapdefault--xh-_question-flow-gapquestion-flow 的 root 部件 gap 覆盖槽。
--xh-question-flow-group-gapgroupgapdefault--xh-space-1question-flow 的 group 部件 gap 覆盖槽。
--xh-question-flow-icon-sizeroot--xh-icon-sizedefault
size=lg
size=md
size=sm
--xh-glyph-size-lg
--xh-glyph-size-md
--xh-glyph-size-sm
question-flow 的 root 部件 --xh-icon-size 覆盖槽。
--xh-question-flow-indicator-bgitem-indicatorbackgrounddefaulttransparentquestion-flow 的 item-indicator 部件 background 覆盖槽。
--xh-question-flow-indicator-bg-checkeditem-indicatorbackgroundstate=checked--xh-_tonequestion-flow 的 item-indicator 部件 background 覆盖槽。
--xh-question-flow-indicator-borderitem-indicatorborderdefault--xh-border-controlquestion-flow 的 item-indicator 部件 border 覆盖槽。
--xh-question-flow-indicator-border-checkeditem-indicatorborder-colorstate=checked--xh-_tonequestion-flow 的 item-indicator 部件 border-color 覆盖槽。
--xh-question-flow-indicator-fgitem-indicatorcolordefault--xh-_tone-onquestion-flow 的 item-indicator 部件 color 覆盖槽。
--xh-question-flow-indicator-icon-sizeitem-indicator--xh-icon-sizedefault--xh-_question-flow-indicator-glyphquestion-flow 的 item-indicator 部件 --xh-icon-size 覆盖槽。
--xh-question-flow-indicator-radiusitem-indicatorborder-radiusdefault--xh-shape-insetquestion-flow 的 item-indicator 部件 border-radius 覆盖槽。
--xh-question-flow-indicator-radius-singleitem-indicatorborder-radiusselect-mode=single--xh-shape-circlequestion-flow 的 item-indicator 部件 border-radius 覆盖槽。
--xh-question-flow-indicator-sizeitem-indicator--xh-icon-size
block-size
inline-size
default
empty
select-mode=single
--xh-_question-flow-indicatorquestion-flow 的 item-indicator 部件 --xh-icon-size、block-size、inline-size 覆盖槽。
--xh-question-flow-item-bgitembackground-colordefault--xh-_action-variant-bg-restquestion-flow 的 item 部件 background-color 覆盖槽。
--xh-question-flow-item-bg-hoveritembackground-colordisabled
hover
loading
not([data-disabled])
not([data-loading])
--xh-_action-variant-bg-hoverquestion-flow 的 item 部件 background-color 覆盖槽。
--xh-question-flow-item-fgitemcolordefault
disabled
hover
is(:active, [data-pressed])
loading
not([data-disabled])
not([data-loading])
pressed
--xh-fg-mutedquestion-flow 的 item 部件 color 覆盖槽。
--xh-question-flow-item-fg-checkeditemcolordisabled
hover
is(:active, [data-pressed])
loading
not([data-disabled])
not([data-loading])
pressed
state=checked
--xh-fg-defaultquestion-flow 的 item 部件 color 覆盖槽。
--xh-question-flow-item-font-sizeitemfont-sizedefault--xh-_question-flow-font-sizequestion-flow 的 item 部件 font-size 覆盖槽。
--xh-question-flow-item-gapitemgapdefault--xh-space-1_5question-flow 的 item 部件 gap 覆盖槽。
--xh-question-flow-item-pxitempadding-inlinedefault--xh-space-2question-flow 的 item 部件 padding-inline 覆盖槽。
--xh-question-flow-item-pyitempadding-blockxh-action-profile=row--xh-space-1question-flow 的 item 部件 padding-block 覆盖槽。
--xh-question-flow-item-radiusitemborder-radiusdefault--xh-_action-profile-radiusquestion-flow 的 item 部件 border-radius 覆盖槽。
--xh-question-flow-note-bgnotebackgrounddefault--xh-bg-surfacequestion-flow 的 note 部件 background 覆盖槽。
--xh-question-flow-note-bordernoteborderdefault--xh-border-controlquestion-flow 的 note 部件 border 覆盖槽。
--xh-question-flow-note-fgnotecolordefault--xh-fg-defaultquestion-flow 的 note 部件 color 覆盖槽。
--xh-question-flow-note-font-sizenotefont-sizedefault--xh-_question-flow-font-sizequestion-flow 的 note 部件 font-size 覆盖槽。
--xh-question-flow-note-pxnotepadding-inlinedefault--xh-space-2question-flow 的 note 部件 padding-inline 覆盖槽。
--xh-question-flow-note-pynotepadding-blockdefault--xh-space-1_5question-flow 的 note 部件 padding-block 覆盖槽。
--xh-question-flow-note-radiusnoteborder-radiusdefault--xh-shape-controlquestion-flow 的 note 部件 border-radius 覆盖槽。
--xh-question-flow-paddingrootpaddingdefault--xh-_question-flow-pquestion-flow 的 root 部件 padding 覆盖槽。
--xh-question-flow-placeholder-fgnotecolorplaceholder--xh-fg-subtlequestion-flow 的 note 部件 color 覆盖槽。
--xh-question-flow-prompt-fgpromptcolordefault--xh-fg-defaultquestion-flow 的 prompt 部件 color 覆盖槽。
--xh-question-flow-prompt-font-sizepromptfont-sizedefault--xh-text-label-sizequestion-flow 的 prompt 部件 font-size 覆盖槽。
--xh-question-flow-prompt-font-weightpromptfont-weightdefault--xh-font-weight-semiboldquestion-flow 的 prompt 部件 font-weight 覆盖槽。
--xh-question-flow-question-gapquestiongapdefault--xh-space-2question-flow 的 question 部件 gap 覆盖槽。
--xh-question-flow-radiusrootborder-radiusdefault--xh-shape-surfacequestion-flow 的 root 部件 border-radius 覆盖槽。
--xh-question-flow-result-bgresultbackgrounddefault--xh-bg-subtlequestion-flow 的 result 部件 background 覆盖槽。
--xh-question-flow-result-fgresultcolordefault--xh-fg-successquestion-flow 的 result 部件 color 覆盖槽。
--xh-question-flow-result-font-sizeresultfont-sizedefault--xh-text-caption-sizequestion-flow 的 result 部件 font-size 覆盖槽。
--xh-question-flow-result-font-weightresultfont-weightdefault--xh-text-label-weightquestion-flow 的 result 部件 font-weight 覆盖槽。
--xh-question-flow-result-gapresultgapdefault--xh-space-1_5question-flow 的 result 部件 gap 覆盖槽。
--xh-question-flow-result-pxresultpadding-inlinedefault--xh-space-2question-flow 的 result 部件 padding-inline 覆盖槽。
--xh-question-flow-result-pyresultpadding-blockdefault--xh-space-1question-flow 的 result 部件 padding-block 覆盖槽。
--xh-question-flow-result-radiusresultborder-radiusdefault--xh-shape-pillquestion-flow 的 result 部件 border-radius 覆盖槽。
--xh-question-flow-shadowrootbox-shadowdefaultnonequestion-flow 的 root 部件 box-shadow 覆盖槽。
--xh-question-flow-skip-bgskip-triggerbackground-colordefault--xh-_action-variant-bg-restquestion-flow 的 skip-trigger 部件 background-color 覆盖槽。
--xh-question-flow-skip-bg-hoverskip-triggerbackground-colordisabled
hover
loading
not([data-disabled])
not([data-loading])
--xh-_action-variant-bg-hoverquestion-flow 的 skip-trigger 部件 background-color 覆盖槽。
--xh-question-flow-skip-fgskip-triggercolordefault--xh-fg-mutedquestion-flow 的 skip-trigger 部件 color 覆盖槽。
--xh-question-flow-skip-fg-hoverskip-triggercolordisabled
hover
is(:active, [data-pressed])
loading
not([data-disabled])
not([data-loading])
pressed
--xh-fg-defaultquestion-flow 的 skip-trigger 部件 color 覆盖槽。
--xh-question-flow-step-bgnext-trigger
prev-trigger
background-colordefault--xh-_action-variant-bg-restquestion-flow 的 next-trigger、prev-trigger 部件 background-color 覆盖槽。
--xh-question-flow-step-bg-hovernext-trigger
prev-trigger
background-colordisabled
hover
loading
not([data-disabled])
not([data-loading])
--xh-_action-variant-bg-hoverquestion-flow 的 next-trigger、prev-trigger 部件 background-color 覆盖槽。
--xh-question-flow-step-fgnext-trigger
prev-trigger
colordefault--xh-fg-subtlequestion-flow 的 next-trigger、prev-trigger 部件 color 覆盖槽。
--xh-question-flow-step-fg-hovernext-trigger
prev-trigger
colordisabled
hover
is(:active, [data-pressed])
loading
not([data-disabled])
not([data-loading])
pressed
--xh-fg-defaultquestion-flow 的 next-trigger、prev-trigger 部件 color 覆盖槽。
--xh-question-flow-step-paddingnext-trigger
prev-trigger
padding-inlinedefault--xh-_action-profile-padding-inlinequestion-flow 的 next-trigger、prev-trigger 部件 padding-inline 覆盖槽。
--xh-question-flow-step-radiusnext-trigger
prev-trigger
border-radiusdefault--xh-shape-insetquestion-flow 的 next-trigger、prev-trigger 部件 border-radius 覆盖槽。
--xh-question-flow-step-sizenext-trigger
prev-trigger
block-size
inline-size
min-block-size
default
xh-action-profile=icon
xh-action-profile=row
--xh-_action-profile-visual-sizequestion-flow 的 next-trigger、prev-trigger 部件 block-size、inline-size、min-block-size 覆盖槽。
--xh-question-flow-submit-bgsubmit-triggerbackground-colordefault--xh-_action-variant-bg-restquestion-flow 的 submit-trigger 部件 background-color 覆盖槽。
--xh-question-flow-submit-bg-activesubmit-triggerbackground-colordisabled
is(:active, [data-pressed])
loading
not([data-disabled])
not([data-loading])
pressed
--xh-_action-variant-bg-pressedquestion-flow 的 submit-trigger 部件 background-color 覆盖槽。
--xh-question-flow-submit-bg-hoversubmit-triggerbackground-colordisabled
hover
loading
not([data-disabled])
not([data-loading])
--xh-_action-variant-bg-hoverquestion-flow 的 submit-trigger 部件 background-color 覆盖槽。
--xh-question-flow-submit-bg-offsubmit-triggerbackground-colordisabled--xh-_action-variant-bg-disabledquestion-flow 的 submit-trigger 部件 background-color 覆盖槽。
--xh-question-flow-submit-fgsubmit-triggercolordefault
disabled
hover
is(:active, [data-pressed])
loading
not([data-disabled])
not([data-loading])
pressed
--xh-_action-variant-fg-hover
--xh-_action-variant-fg-pressed
--xh-_action-variant-fg-rest
question-flow 的 submit-trigger 部件 color 覆盖槽。
--xh-question-flow-submit-shadowsubmit-triggerbox-shadowdefault
disabled
hover
is(:active, [data-pressed])
loading
not([data-disabled])
not([data-loading])
pressed
--xh-_highlight-tonequestion-flow 的 submit-trigger 部件 box-shadow 覆盖槽。
--xh-question-flow-track-gaptrackgapdefault--xh-_question-flow-gapquestion-flow 的 track 部件 gap 覆盖槽。
--xh-question-flow-track-ytracktranslatedefault--xh-_question-flow-track-yquestion-flow 的 track 部件 translate 覆盖槽。
--xh-question-flow-viewport-hviewportblock-sizedefault--xh-_question-flow-viewport-hquestion-flow 的 viewport 部件 block-size 覆盖槽。

动效

关键帧 xh-question-flow-in · xh-question-flow-result-in 随皮肤自带,不引用别处文件里的名字;共享关键帧 xh-rise-infamily/motion.css 提供,皮肤 @import 它,单独引入仍成立;background · block-size · border-color · color · opacity · translatetransition 过渡。时长与缓动读动效令牌,改令牌即改全局节奏。

系统开启减弱动效时由令牌层统一收敛,皮肤不另作判断。

RTL

皮肤用逻辑属性排布(inline-start 一族),dir="rtl" 下自动镜像。

Released under The MIT License