生态产品多个设计器现已发布候选版本

查看生态总览
跳转到内容

Citation 引用来源 alpha ​

把回答中的行内引用、可展开的来源预览和文末来源列表连成同一套可访问关系。@xihan-ui/chat-stream 的 SourcePart[] 与 sources 结构兼容,可以直接传入。

用法 ​

SourcePart 直接驱动行内引用、来源预览和来源列表

共享原语可以减少产品之间的不一致 , 明确的可访问关系让引用在键盘与读屏中仍可追踪 。

组件结构 ​

加粗的是必需部件。

data-scope="citation":root · text · trigger · positioner · preview · preview-header · preview-title · preview-meta · quote · preview-link · dismiss-trigger · prev-trigger · next-trigger · preview-index · list · source · source-link · source-index · source-title · source-meta

示例 ​

受控状态 ​

activeSourceId 与 open 分别写回,来源数据仍是唯一真源

这段结论同时参考了主研究 与后续分析。
Follow-up analysisexample.com
Follow-up evidence.
Open source

文档来源 ​

source-open 把文档 SourcePart 与锚点交给宿主打开

引用也可以指向宿主托管的文档。
Design handbook.pdfapplication/pdf
Every citation keeps its original locator.

尚未请求打开文档

键盘导航 ​

来源列表使用单一 Tab 位,方向键、Home、End 移动,Enter 打开预览

聚焦来源后使用 ↑ / ↓、Home、End,并按 Enter 查看。

悬停预览 ​

preview-mode="hover" 把预览放进 positioner,锚定在引用编号旁:指针停留或聚焦即出现、离开即收起,不推动正文;卡片开着时指向另一处引用直接切过去

共享原语可以减少产品之间的不一致 , 明确的可访问关系让引用在键盘与读屏中仍可追踪 。

一处多源 ​

一处引用引了几个来源时写 source-ids,预览里用上一个 / 下一个在它们之间轮换,位置写在两颗翻页钮之间

共享原语可以减少产品之间的不一致 。

设计指引 ​

何时使用 ​

  • AI 回答、研究摘要或知识库结果需要标出结论依据,并允许用户核对原文。
  • 同一来源既要在正文中以短编号出现,也要在文末列表中保留完整标题与类型。

何时不用 ​

  • 只是普通脚注、无需展开预览或来源交互:使用语义化链接和有序列表即可。
  • 内容是导航目录而非证据来源:使用锚点导航。

特性 ​

  • 行内 trigger 用 aria-controls / aria-expanded 指向唯一 preview region;预览再以 aria-labelledby 指回打开入口。
  • 来源列表只占一个 Tab 位,支持 ↑ / ↓、Home、End 与 Enter / Space;Escape 收起预览并按需归还焦点。
  • 预览有两种出现方式,由 previewMode 决定:
    • inline(缺省):预览是正文流里的一块面,展开时从 0 长到整块、收起时收回 0,后面的段落随之平移;首帧就开着的预览直接呈现。缺省取它:现有结构不用改,也不依赖悬停,触屏与键盘同样顺手。
    • hover:预览放进 positioner 部件,锚定在引用编号旁的悬停卡片,搬到 portal 落点、不推动正文。指针停留 openDelay(缺省 700ms)出现,离开编号与卡片 closeDelay(缺省 300ms)后收起,中途移进卡片即撤销;卡片开着或刚收起不到 skipDelayDuration(缺省 300ms)时,指向另一处引用直接接替,与悬停卡片、文字提示同一套节奏。焦点落到引用上当场打开,焦点离开引用与卡片即收起;触屏没有悬停,点按照常开合。Escape 与卡片外的按下都会收起它。
  • 一处引用引了几个来源时写 sourceIds(Web Components 在 value 里写成空白分隔的几个 id),预览里的 prev-trigger / next-trigger 在这几个来源之间轮换,preview-index 显示「2 / 3」;只有一个来源时三者收起。hover 档轮换时卡片就地换内容,不再播一次出现。
  • URL 来源保留原生链接导航;文档来源通过 source-open 把 SourcePart 与当前 anchor 交回宿主。
  • activeSourceId 与 open 可分别受控,受控时只有宿主写回才改变可见状态。
  • 正文里的引用常随流式正文到达:把流式正文放进 text 部件,在它的 citation 插槽里渲 trigger。首帧一个引用都没有是真实首帧,text 与 trigger 都不是必需部件。

最佳实践 ​

  • sourceId 在一组来源中保持稳定且唯一;同一来源的多次行内引用用不同 citationId。
  • anchors 中保存足以核验的短引文,完整文档仍由来源链接或宿主查看器承担。
  • 不要让引用编号代替正文:读屏名称会组合来源顺序与标题,但正文应在去掉引用后仍然可读。

API 参考 ​

产物 ​

层值
自定义元素<xh-citation>
Vue 组件XhCitationList XhCitationPositioner XhCitationPreview XhCitationRoot XhCitationSource XhCitationSourceIndex XhCitationSourceLink XhCitationSourceMeta XhCitationSourceTitle XhCitationText XhCitationTrigger
组合式函数useCitation
状态机citationMachine
皮肤@xihan-ui/styles/citation.css

Props ​

属性类型必填说明
previewModeCitationPreviewMode预览怎样出现,缺省 inline。 hover 档要在根里放 positioner 部件,预览放进它里面,定位到当前引用编号旁。
openDelaynumberhover 档:指针停在引用上到卡片出现的等待毫秒,缺省 700。
closeDelaynumberhover 档:指针离开引用与卡片到收起的等待毫秒,缺省 300;也是从编号挪进卡片的通行时间。
skipDelayDurationnumberhover 档:卡片刚收起不到这么久,指向另一处引用即直接出现、不再等 openDelay,缺省 300; 卡片开着时指向另一处引用始终直接切过去。0 表示不接替。
placementPlacementhover 档:卡片相对引用编号的朝向,缺省 bottom,空间不足时由定位引擎避让。
offsetnumberhover 档:卡片与引用编号的间距(px)。
sourcesreadonly CitationSource[]@xihan-ui/chat-stream 的 SourcePart[] 可直接传入。
activeSourceIdstring | null
defaultActiveSourceIdstring | null
openboolean
defaultOpenboolean
disabledboolean
loopboolean
dirDirection
sizeSize
translationsPartial<CitationTranslations>
onActiveSourceChange(details: CitationActiveSourceChangeDetails) => void
onOpenChange(details: CitationOpenChangeDetails) => void
onSourceOpen(details: CitationSourceOpenDetails) => void打开原始来源;URL 的默认链接仍会正常导航,同时发出该通知。

事件 ​

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

事件载荷说明
active-source-changeCitationActiveSourceChangeDetails当前来源变化
open-changeCitationOpenChangeDetails预览展开态变化
source-openCitationSourceOpenDetails用户请求打开原始来源

React 适配器 props ​

只列各组件自己声明的那些:继承自 ComponentPropsWithRef 的 DOM 属性不在其中,根组件上与上面 Props 表同名的也不重复列。Vue 的对应物是上面的插槽表。

React 组件属性类型必填说明
XhCitationPositionercontainerPortalContainer本实例的 Portal 容器;优先于应用级配置。
XhCitationPreviewsourceIdstring是
XhCitationPreviewanchorIndexnumber
XhCitationRootchildrenReactNode
XhCitationSourcesourceIdstring是
XhCitationSourcedisabledboolean
XhCitationTriggersourceIdstring这一处引用的来源;一处引多个来源时改写 sourceIds,两者只写一个。
XhCitationTriggersourceIdsreadonly string[]一处引用多个来源,预览里可以在它们之间轮换。
XhCitationTriggercitationIdstring
XhCitationTriggeranchorIndexnumber

状态 ​

公开状态写入 data-state。

部件取值
trigger'open' | 'closed'
positioner'open' | 'closed'
preview'open' | 'closed'
source'active' | 'inactive'
source-link'active' | 'inactive'

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

状态:idle · opening · closing

事件:CITATION.ACTIVATE · TRIGGER.ENTER · POINTER.LEAVE · FLOATING.ENTER · TRIGGER.FOCUS · FLOATING.FOCUS · HOVER.BLUR · after.openDelay · after.closeDelay · GROUP.STEP · DISMISS · SOURCE.ACTIVATE · SOURCE.OPEN · SOURCE.FOCUS · LIST.BLUR · OPEN.SET · PREVIEW.MEASURED · PREVIEW.LEFT

判据:isHoverMode · isVisible · isWarm · isFocusHeld · isSameTarget

connect API ​

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

成员类型说明
sourcesreadonly CitationSource[]
activeSourceCitationSource | null
activeSourceIdstring | null
activeAnchorIndexnumber | null
activeGroupreadonly string[] | null当前那处引用引到的全部来源;只有一个或从来源列表打开时为 null。
previewModeCitationPreviewMode
openboolean
focusedSourceIdstring | null
setOpen(next: boolean) => void
setActiveSource(sourceId: string) => void
getRootProps() => T['element']
getTextProps() => T['element']
getTriggerProps(props: CitationTriggerProps) => T['button']
getPositionerProps() => T['element']hover 档的浮层定位壳;inline 档不参与排版(display: contents)。
getPreviewProps(props: CitationPreviewProps) => T['element']
getPreviewHeaderProps(props: CitationPreviewProps) => T['element']
getPreviewTitleProps(props: CitationPreviewProps) => T['element']
getPreviewMetaProps(props: CitationPreviewProps) => T['element']
getQuoteProps(props: CitationPreviewProps) => T['element']
getPreviewLinkProps(props: CitationPreviewProps) => T['element']
sourceMetaText(source: CitationSource | undefined) => string来源的副文字:网页来源写域名,文档来源写媒体类型,没有媒体类型时取 translations.document。
previewLinkText(props: CitationPreviewProps) => string预览链接上写的字:网页来源取 previewLinkSource,文档来源取 previewLinkDocument。
getDismissTriggerProps(props: CitationPreviewProps) => T['button']
getPrevTriggerProps(props: CitationPreviewProps) => T['button']一处多源时换到上一个来源;只有一个来源时带 hidden。
getNextTriggerProps(props: CitationPreviewProps) => T['button']一处多源时换到下一个来源;只有一个来源时带 hidden。
getPreviewIndexProps(props: CitationPreviewProps) => T['element']一处多源时的位置,如「2 / 3」;只有一个来源时带 hidden。
getPreviewPosition(props: CitationPreviewProps) => { index: number, total: number } | null该预览此刻在一处多源里排第几(1 基)与共几个;不在多源轮换里时为 null。
getListProps() => T['element']
getSourceProps(props: CitationSourceItemProps) => T['element']
getSourceLinkProps(props: CitationSourceItemProps) => T['button']
getSourceIndexProps(props: CitationSourceItemProps) => T['element']
getSourceTitleProps(props: CitationSourceItemProps) => T['element']
getSourceMetaProps(props: CitationSourceItemProps) => T['element']

无障碍 ​

键盘 ​

规格出处:[W3C APG](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/#keyboardinteraction https://www.w3.org/WAI/ARIA/apg/patterns/listbox/#keyboardinteraction)

按键生效条件行为
Space / Enterfocus on inline citation, not disabled展开或收起该引文对应的来源预览
ArrowDownfocus in source list焦点移到下一条可用来源,尽头按 loop 回绕
ArrowUpfocus in source list焦点移到上一条可用来源,尽头按 loop 回绕
Homefocus in source list焦点移到第一条可用来源
Endfocus in source list焦点移到最后一条可用来源
Space / Enterfocus on source list item, not disabled将该来源设为当前来源并展开预览
TabpreviewMode 为 hover,焦点落到行内引用上当场打开该引用的悬停卡片;焦点移进卡片不收起,离开引用与卡片即收起
Space / Enterfocus on previous / next source button in preview, 一处引用引了多个来源在这几个来源之间换到上一个 / 下一个,尽头按 loop 回绕
Escapesource preview open收起预览;若焦点位于预览内则归还到打开它的行内引用或来源条目;hover 档由消解层收起卡片

ARIA ​

以下属性由 connect 生成。

部件属性值
triggeraria-controlspreview 部件的 id
triggeraria-expanded'true' | 'false'
triggeraria-labellabels.citations(ids.map(sourceId => indexOf(sourceId… | labels.citation(indexOf(ids[0]!) + 1, citationSourceT…
previewaria-labellabels.preview | undefined
previewaria-labelledbycontext.get('activeTriggerId') | undefined
previewrole'region'
preview-linkaria-labelledbypreview-link 部件的 id preview-title 部件的 id
dismiss-triggeraria-labellabels.closePreview
preview-indexaria-hidden'true'
listaria-labellabels.sources
listrole'list'
sourcerole'listitem'
source-linkaria-controlspreview 部件的 id
source-linkaria-current'true' | undefined
source-linkaria-expanded'true' | 'false'
source-indexaria-hidden'true'

样式参考 ​

皮肤 ​

@xihan-ui/styles/citation.css 按 [data-scope="citation"][data-part="root"] 部件选择器书写,发布产物以挂载类 .xh-scope-citation 代替其中的 data-scope(特异性相同),位于 xihan.components 与 xihan.motion 层。覆盖样式使用 xihan.overrides,部件选择器照常可用。

forced-colors: active 下另有一套规则:颜色交给系统,边框与状态标记改用系统色关键字。

数据属性 ​

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

部件属性值
rootdata-disabled''(条件成立时才出现)
rootdata-preview-modeprops.previewMode
rootdata-sizeprops.size
triggerdata-disabled''(条件成立时才出现)
triggerdata-state'open' | 'closed'
triggerdata-xh-action-control''
triggerdata-xh-action-display'always'
triggerdata-xh-action-profile'text'
triggerdata-xh-action-size'xs'
triggerdata-xh-action-variant'subtle'
positionerdata-hidden''(条件成立时才出现)
positionerdata-placement定位引擎算出的实际落位 | undefined
positionerdata-positioned''(条件成立时才出现)
positionerdata-preview-modeprops.previewMode
positionerdata-sizeprops.size
positionerdata-state'open' | 'closed'
previewdata-instant''(条件成立时才出现)
previewdata-preview-modeprops.previewMode
previewdata-state'open' | 'closed'
previewdata-xh-material'frosted' | undefined
preview-linkdata-xh-action-control''
preview-linkdata-xh-action-display'always' | undefined
preview-linkdata-xh-action-profile'text' | undefined
preview-linkdata-xh-action-size'sm' | undefined
preview-linkdata-xh-action-variant'ghost' | undefined
dismiss-triggerdata-xh-action-control''
dismiss-triggerdata-xh-action-display'always'
dismiss-triggerdata-xh-action-profile'icon'
dismiss-triggerdata-xh-action-size'xs'
dismiss-triggerdata-xh-action-variant'ghost'
listdata-disabled''(条件成立时才出现)
sourcedata-disabled''(条件成立时才出现)
sourcedata-state'active' | 'inactive'
source-linkdata-current''(条件成立时才出现)
source-linkdata-disabled''(条件成立时才出现)
source-linkdata-state'active' | 'inactive'
source-linkdata-xh-action-control''
source-linkdata-xh-action-display'always'
source-linkdata-xh-action-profile'row'
source-linkdata-xh-action-sizeprops.size
source-linkdata-xh-action-variant'ghost'

CSS 变量 ​

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

变量部件CSS 属性状态默认来源说明
--xh-citation-card-backdroppreview-webkit-backdrop-filter
backdrop-filter
preview-mode=hover
xh-material=frosted
--xh-_material-backdropcitation 的 preview 部件 -webkit-backdrop-filter、backdrop-filter 覆盖槽。
--xh-citation-card-bgpreviewbackgroundnot([data-xh-action-control])
preview-mode=hover
xh-material=frosted
--xh-_material-bgcitation 的 preview 部件 background 覆盖槽。
--xh-citation-card-borderpreviewbordernot([data-xh-action-control])
preview-mode=hover
xh-material=frosted
--xh-_material-bordercitation 的 preview 部件 border 覆盖槽。
--xh-citation-card-fgpreviewcolornot([data-xh-action-control])
preview-mode=hover
xh-material=frosted
--xh-_material-fgcitation 的 preview 部件 color 覆盖槽。
--xh-citation-card-max-hpreviewmax-block-sizepreview-mode=hover--xh-overlay-max-hcitation 的 preview 部件 max-block-size 覆盖槽。
--xh-citation-card-max-wpreviewmax-inline-sizepreview-mode=hover--xh-overlay-max-wcitation 的 preview 部件 max-inline-size 覆盖槽。
--xh-citation-card-quote-linespreview
quote
-webkit-line-clampnot([hidden])
preview-mode=hover
6citation 的 preview、quote 部件 -webkit-line-clamp 覆盖槽。
--xh-citation-card-radiuspreviewborder-radiuspreview-mode=hover--xh-shape-overlaycitation 的 preview 部件 border-radius 覆盖槽。
--xh-citation-card-shadowpreviewbox-shadownot([data-xh-action-control])
preview-mode=hover
xh-material=frosted
--xh-_material-shadowcitation 的 preview 部件 box-shadow 覆盖槽。
--xh-citation-dismiss-trigger-radiusdismiss-triggerborder-radiusdefault--xh-shape-controlcitation 的 dismiss-trigger 部件 border-radius 覆盖槽。
--xh-citation-fgrootcolordefault--xh-fg-defaultcitation 的 root 部件 color 覆盖槽。
--xh-citation-font-sizepositioner
root
font-sizedefault
preview-mode=hover
--xh-_citation-font-sizecitation 的 positioner、root 部件 font-size 覆盖槽。
--xh-citation-gappreview
root
gap
margin-block-start
@keyframes xh-citation-preview-collapse
@keyframes xh-citation-preview-expand
default
not([data-xh-material])
xh-material
--xh-_citation-gapcitation 的 preview、root 部件 gap、margin-block-start 覆盖槽。
--xh-citation-icon-sizepositioner
root
--xh-icon-sizeis([data-part='root'], [data-part='positioner'])--xh-_citation-icon-sizecitation 的 positioner、root 部件 --xh-icon-size 覆盖槽。
--xh-citation-index-active-bgsource
source-index
backgroundstate=active--xh-bg-brandcitation 的 source、source-index 部件 background 覆盖槽。
--xh-citation-index-active-fgsource
source-index
colorstate=active--xh-fg-on-brandcitation 的 source、source-index 部件 color 覆盖槽。
--xh-citation-index-bgsource-indexbackgrounddefault--xh-bg-subtlecitation 的 source-index 部件 background 覆盖槽。
--xh-citation-index-fgsource-indexcolordefault--xh-fg-mutedcitation 的 source-index 部件 color 覆盖槽。
--xh-citation-index-font-sizesource-indexfont-sizedefault--xh-text-caption-sizecitation 的 source-index 部件 font-size 覆盖槽。
--xh-citation-index-radiussource-indexborder-radiusdefault--xh-shape-circlecitation 的 source-index 部件 border-radius 覆盖槽。
--xh-citation-index-sizesource-indexblock-size
min-inline-size
default--xh-control-box-smcitation 的 source-index 部件 block-size、min-inline-size 覆盖槽。
--xh-citation-layerpositionerz-indexpreview-mode=hover--xh-_layercitation 的 positioner 部件 z-index 覆盖槽。
--xh-citation-link-fgpreview-linkcolordefault--xh-fg-brandcitation 的 preview-link 部件 color 覆盖槽。
--xh-citation-list-gaplistgapdefault--xh-space-1citation 的 list 部件 gap 覆盖槽。
--xh-citation-meta-fgpreview-index
preview-meta
source-meta
colordefault--xh-fg-mutedcitation 的 preview-index、preview-meta、source-meta 部件 color 覆盖槽。
--xh-citation-meta-font-sizepreview-index
preview-meta
source-meta
font-sizedefault--xh-text-caption-sizecitation 的 preview-index、preview-meta、source-meta 部件 font-size 覆盖槽。
--xh-citation-pager-radiusnext-trigger
prev-trigger
border-radiusdefault--xh-shape-controlcitation 的 next-trigger、prev-trigger 部件 border-radius 覆盖槽。
--xh-citation-preview-bgpreviewbackgroundnot([data-xh-material])
xh-material
--xh-bg-surfacecitation 的 preview 部件 background 覆盖槽。
--xh-citation-preview-borderpreviewbordernot([data-xh-material])
xh-material
--xh-border-defaultcitation 的 preview 部件 border 覆盖槽。
--xh-citation-preview-fgpreviewcolornot([data-xh-material])
xh-material
--xh-fg-defaultcitation 的 preview 部件 color 覆盖槽。
--xh-citation-preview-gappreviewgapdefault--xh-space-3citation 的 preview 部件 gap 覆盖槽。
--xh-citation-preview-header-content-gappreview-headergapfirst-child--xh-space-0_5citation 的 preview-header 部件 gap 覆盖槽。
--xh-citation-preview-header-gappreview-headergapdefault--xh-space-3citation 的 preview-header 部件 gap 覆盖槽。
--xh-citation-preview-link-radiuspreview-linkborder-radiusfocus-visible--xh-shape-controlcitation 的 preview-link 部件 border-radius 覆盖槽。
--xh-citation-preview-pxpreviewpadding-inlinedefault--xh-_citation-padcitation 的 preview 部件 padding-inline 覆盖槽。
--xh-citation-preview-pypreviewpadding-blockdefault--xh-_citation-padcitation 的 preview 部件 padding-block 覆盖槽。
--xh-citation-preview-radiuspreviewborder-radiusnot([data-xh-material])
xh-material
--xh-shape-surfacecitation 的 preview 部件 border-radius 覆盖槽。
--xh-citation-quote-borderquoteborder-inline-startdefault--xh-fg-brandcitation 的 quote 部件 border-inline-start 覆盖槽。
--xh-citation-quote-fgquotecolordefault--xh-fg-mutedcitation 的 quote 部件 color 覆盖槽。
--xh-citation-quote-font-sizequotefont-sizedefault--xh-text-secondary-sizecitation 的 quote 部件 font-size 覆盖槽。
--xh-citation-quote-psquotepadding-inline-startdefault--xh-space-3citation 的 quote 部件 padding-inline-start 覆盖槽。
--xh-citation-source-fgsource-linkcolordefault--xh-fg-defaultcitation 的 source-link 部件 color 覆盖槽。
--xh-citation-source-link-content-gapsource-linkgaplast-child--xh-space-0_5citation 的 source-link 部件 gap 覆盖槽。
--xh-citation-source-pxsource-linkpadding-inlinedefault--xh-space-3citation 的 source-link 部件 padding-inline 覆盖槽。
--xh-citation-source-pysource-linkpadding-blockxh-action-profile=row--xh-space-2citation 的 source-link 部件 padding-block 覆盖槽。
--xh-citation-source-radiussource-linkborder-radiusdefault--xh-shape-controlcitation 的 source-link 部件 border-radius 覆盖槽。
--xh-citation-source-title-fgsource-titlecolordefault--xh-fg-defaultcitation 的 source-title 部件 color 覆盖槽。
--xh-citation-text-fgtextcolordefault--xh-fg-defaultcitation 的 text 部件 color 覆盖槽。
--xh-citation-title-fgpreview-titlecolordefault--xh-fg-defaultcitation 的 preview-title 部件 color 覆盖槽。
--xh-citation-title-font-sizepreview-titlefont-sizedefault--xh-text-label-sizecitation 的 preview-title 部件 font-size 覆盖槽。
--xh-citation-title-font-weightpreview-titlefont-weightdefault--xh-font-weight-mediumcitation 的 preview-title 部件 font-weight 覆盖槽。
--xh-citation-trigger-fgtriggercolordefault
disabled
hover
is(:active, [data-pressed])
loading
not([data-disabled])
not([data-loading])
pressed
--xh-fg-brandcitation 的 trigger 部件 color 覆盖槽。
--xh-citation-trigger-font-sizetriggerfont-sizedefault--xh-text-caption-sizecitation 的 trigger 部件 font-size 覆盖槽。
--xh-citation-trigger-htriggerblock-size
inline-size
min-block-size
min-inline-size
default
xh-action-profile=icon
xh-action-profile=row
--xh-space-6citation 的 trigger 部件 block-size、inline-size、min-block-size、min-inline-size 覆盖槽。
--xh-citation-trigger-margintriggermargin-inlinedefault--xh-space-0_5citation 的 trigger 部件 margin-inline 覆盖槽。
--xh-citation-trigger-pxtriggerpadding-inlinedefault--xh-space-1citation 的 trigger 部件 padding-inline 覆盖槽。
--xh-citation-trigger-radiustriggerborder-radiusdefault--xh-shape-pillcitation 的 trigger 部件 border-radius 覆盖槽。

动效 ​

动效角色:按压 · 状态 · 披露 · 出现(见动效规范)。

关键帧 xh-citation-preview-collapse · xh-citation-preview-expand 随皮肤自带,不引用别处文件里的名字;共享关键帧 xh-overlay-pop-in · xh-pop-out 由 family/motion.css 提供,皮肤 @import 它,单独引入仍成立;background-color · color 走 transition 过渡。时长与缓动读动效令牌,改令牌即改全局节奏。

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

RTL ​

皮肤用逻辑属性排布(inline-start 一族),dir="rtl" 下自动镜像;只认物理方向的量乘 --xh-direction-sign 换向,按就近的 dir 走。

Released under The MIT License