跳转到内容

Menubar 菜单栏 ​

用于桌面应用的横向命令菜单栏。

用法 ​

在一条菜单栏中组织应用命令

组件结构 ​

加粗的是必需部件。

data-scope="menubar":root · trigger · positioner · content · item · item-text · item-indicator · item-description · item-shortcut · item-suffix · separator · group · group-label · arrow

示例 ​

分组 ​

在菜单内组织相关命令

图标与快捷键 ​

补充常用命令的识别信息

子菜单 ​

在菜单栏命令中打开下一层

设计指引 ​

何时使用 ​

  • 在编辑器或桌面应用中按“文件、编辑、视图”组织命令。

何时不用 ​

  • 站点导航使用导航菜单。
  • 单个入口使用菜单。
  • 窄屏和触摸优先界面不适合菜单栏。

特性 ​

  • 同一时间只展开一个顶层菜单。
  • 展开后移向相邻入口会直接切换菜单。
  • 支持方向键、首字符检索、禁用项、分组与子菜单。
  • 条目可逐条声明语气;顶层入口表达的是位置,不接语气。
  • 说明与快捷键提示都可写进 collection;快捷键贴行尾,与说明同档同色。
  • 条目可组合图标、文字、说明和快捷键提示。
  • 首次展开与最终关闭使用短距离淡变,顶层菜单切换不播放交叉动画。

组合 ​

  • 菜单栏应放在宽度稳定的应用顶栏中。

最佳实践 ​

  • 顶层入口使用单个名词,并控制在少量常用分类内。
  • 破坏性命令放在菜单末尾并与普通命令分隔。
  • 仅为已注册的快捷键显示提示。

反模式 ​

  • 不要在菜单栏中堆积过多顶层入口。
  • 不要用菜单栏代替持久选项控件。

API 参考 ​

产物 ​

层值
自定义元素<xh-menubar>
Vue 组件XhMenubarArrow XhMenubarContent XhMenubarGroup XhMenubarGroupLabel XhMenubarItem XhMenubarItemDescription XhMenubarItemIndicator XhMenubarItemShortcut XhMenubarItemSuffix XhMenubarItemText XhMenubarPositioner XhMenubarRoot XhMenubarSeparator XhMenubarSub XhMenubarSubTrigger XhMenubarTrigger
组合式函数useMenubar
状态机menubarMachine
皮肤@xihan-ui/styles/menubar.css

Props ​

属性类型必填说明
collectionMenubarNode[]菜单栏数据,显示文本与禁用的事实源。提供后入口与条目部件只需声明 value。 未提供时回到文本与禁用逐个写在部件上的方式。
valuestring | null当前展开项,提供即受控;null 表示全部收起。
defaultValuestring | null
orientationOrientation菜单栏排布轴,默认 horizontal。
loopboolean方向键到达末尾是否回绕,默认 true。
dirDirection文字方向,默认 ltr。
disabledboolean整条菜单栏禁用,展开与选中都不发生。
typeaheadboolean菜单内的连打检索,默认开启。
placementPlacement
offsetnumber
toneTone语气:brand / neutral / success / warning / danger / info,决定使用哪族颜色。
sizeSize尺寸:sm / md / lg。
translationsPartial<MenubarTranslations>
onValueChange(details: MenubarValueChangeDetails) => voidvalue 变化回调。
onSelect(details: MenubarSelectDetails) => void条目被选中;菜单随之收起。

collection 的元素。

字段类型必填说明
valuestring是
labelstring展示文本,也是菜单内连打检索的取字来源;默认回退为 value。
descriptionstring副文本,写入 item-description 部件;只在条目上读取。
shortcutstring快捷键提示,写入 item-shortcut 部件;未提供时本条不铺该部件。 纯装饰:读屏从条目文字取意,不念它;只为真正注册了的组合写提示。
disabledboolean禁用:方向键跳过它,但它仍可聚焦、仍是导航起点。
toneTone该条命令自身动作的性质:删除写 danger、停用写 warning。只在条目上读取—— 顶层入口表达的是位置不是动作,写了也不产出语气面。 只换字色与悬停 / 按下的面,不改字重与缩进;禁用压过它,破坏性命令仍要配图标。
groupstring所属分组的身份;相邻同值的条目合并为一个 group。只在条目上读取。
groupLabelstring本组的标题文本,写在组内任意一条上即可。只在条目上读取。
separatorBeforeboolean本条之前绘制一条分隔线;写在首条上不产出分隔线。只在条目上读取。
itemsMenubarNode[]该菜单中的条目;只在顶层节点上读取。

事件 ​

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

事件载荷说明
value-changeMenubarValueChangeDetails展开项变化;detail 为 { value: string | null }
selectMenubarSelectDetails条目被选中(菜单随之收起);detail 为 { menu: string, value: string }

插槽 ​

仅列出带载荷的插槽。

Vue 组件插槽载荷说明
XhMenubarRootdefaultMenubarRootSlotProps
XhMenubarRootitemMenubarNodeMeta只填条目的文字槽,标记位、副文本与快捷键照旧由数据铺
XhMenubarRootitem-prefixMenubarNodeMeta只接管行首那一格,其余槽照旧由数据铺
XhMenubarRootitem-suffixMenubarNodeMeta只接管行尾那一格(计数、徽标、次级图标),其余槽照旧由数据铺
XhMenubarSubdefaultMenubarSubSlotProps

React 适配器 props ​

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

React 组件属性类型必填说明
XhMenubarContentvaluestring默认时沿用外层 positioner 提供的身份,无 positioner 时必填。
XhMenubarGroupvaluestring是
XhMenubarItemvaluestring是
XhMenubarItemdisabledboolean默认交给 connect 查询 collection,写死 false 会覆盖数据中的禁用。
XhMenubarPositionervaluestring是
XhMenubarPositionercontainer() => Element | null浮层挂载的容器;未提供时按全局配置,再未提供时挂载到 body。
XhMenubarRootrenderItem(node: MenubarNodeMeta) => ReactNode每个条目的自定义内容;未提供时使用 collection 中的 label。
XhMenubarRootrenderItemPrefix(node: MenubarNodeMeta) => ReactNode只接管条目行首那一格;其余槽仍由数据铺。
XhMenubarRootrenderItemSuffix(node: MenubarNodeMeta) => ReactNode只接管条目行尾那一格(计数、徽标、次级图标);其余槽仍由数据铺。
XhMenubarRootchildrenSlotChildren<MenubarRootSlotProps>
XhMenubarSubvaluestring是它在所属菜单中的条目身份。
XhMenubarSubdisabledboolean
XhMenubarSubplacementPlacement
XhMenubarSuboffsetnumber
XhMenubarSubloopboolean
XhMenubarSubopenOnHoverboolean
XhMenubarSubhoverOpenDelaynumber
XhMenubarSubhoverCloseDelaynumber
XhMenubarSubdirDirection文字方向;默认继承父层。子层被迁移到浮层落点,无法继承父层的方向。
XhMenubarSubtoneTone语气;默认继承父层。子层是浮层落点下的同级节点,CSS 私有槽无法继承。
XhMenubarSubsizeSize尺寸;默认继承父层,理由同 tone。
XhMenubarSubchildrenSlotChildren<MenubarSubSlotProps>
XhMenubarTriggervaluestring是
XhMenubarTriggerdisabledboolean默认交给 connect 查询 collection,写死 false 会覆盖数据中的禁用。

状态 ​

公开状态写入 data-state。

部件取值
root'open' | 'closed'
trigger'open' | 'closed'
positioner'open' | 'closed'
content'open' | 'closed'

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

状态:idle · open

事件:TRIGGER.TOGGLE · TRIGGER.OPEN · TRIGGER.POINTER · TRIGGER.FOCUS · CLOSE · MENUBAR.BLUR · VALUE.SET · PRESENCE.SET · ITEM.FOCUS · ITEM.LOST · ITEM.SELECT · PRESS.START · PRESS.END · SYNC.OPEN · SYNC.CLOSE

判据:hasValue · isCurrent · shouldAbsorbToggle · shouldSwitch · canPress

connect API ​

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

成员类型说明
valuestring | null当前展开的项;全部收起时为 null。
collectionreadonly MenubarNodeMeta[]由 collection 推导的入口元信息(各自附带该菜单的条目),按数据顺序排列;未提供 collection 时为空数组。
openboolean是否有菜单展开。
focusedValuestring | nulltrigger 的 roving 锚点;焦点不在菜单栏内时为 null。
focusedItemstring | null展开菜单内持有焦点的条目;无锚点时为 null。
orientationOrientation
disabledboolean
isOpen(value: string) => boolean
setValue(next: string | null) => void
getRootProps() => T['element']
getTriggerProps(props: MenubarTriggerProps) => T['button']
getPositionerProps(props: MenubarContentProps) => T['element']
getContentProps(props: MenubarContentProps) => T['element']
getItemProps(props: MenubarItemProps) => T['element']
getItemTextProps(props: MenubarItemProps) => T['element']
getItemIndicatorProps(props: MenubarItemProps) => T['element']
getItemDescriptionProps(props: MenubarItemProps) => T['element']
getItemShortcutProps(props: MenubarItemProps) => T['element']
getItemSuffixProps(props: MenubarItemProps) => T['element']
getSeparatorProps() => T['element']
getGroupProps(props: MenubarGroupProps) => T['element']
getGroupLabelProps(props: MenubarGroupProps) => T['element']
getArrowProps(props: MenubarContentProps) => T['element']

无障碍 ​

键盘 ​

规格出处:W3C APG

按键生效条件行为
ArrowRightfocus in trigger, horizontal焦点移到下一个 trigger(禁用项跳过、尽头按 loop 回绕);已有菜单展开着则展开项跟着切过去
ArrowLeftfocus in trigger, horizontal焦点移到上一个 trigger(禁用项跳过、尽头按 loop 回绕);已有菜单展开着则展开项跟着切过去
Homefocus in trigger焦点移到首个可用 trigger
Endfocus in trigger焦点移到末个可用 trigger
ArrowDown / Enter / Spacefocus in trigger, horizontal展开本项的菜单;方向键入口把焦点落到首个可用条目,Enter/Space 让焦点留在 trigger 上
ArrowUpfocus in trigger, horizontal展开本项的菜单并把焦点落到末个可用条目
ArrowDownopen, focus in content焦点移到下一个条目(禁用项跳过、尽头按 loop 回绕)
ArrowUpopen, focus in content焦点移到上一个条目(禁用项跳过、尽头按 loop 回绕)
Homeopen, focus in content焦点移到本张菜单的首个可用条目
Endopen, focus in content焦点移到本张菜单的末个可用条目
ArrowRight / ArrowLeftopen, focus in content切到相邻菜单并保持展开,焦点落到那一项的 trigger 上
a-z / 0-9open, focus in content连打检索:焦点跳到首字母匹配的条目(同字符连打则在候选间轮换)
Enter / Spacefocus in item, not disabled派发选中详情并收起菜单,焦点归还 trigger
Enter / Spaceheld in trigger / item, not disabled按住期间该部件投影 data-pressed,与指针 :active 同一副按压面;抬起或失焦撤下,条目随菜单收起一并撤下
Escapeopen收起菜单并把焦点留在 trigger 上
Tab / Shift+Tabopen收起菜单,焦点不被抢回 trigger,按 Tab 序列自然离开

ARIA ​

以下属性由 connect 生成。

部件属性值
rootaria-disabled'true' | 'false'
rootaria-labelprops.translations.root
rootaria-orientationprops.orientation
rootrole'menubar'
triggeraria-controlscontent 部件的 id
triggeraria-disabled'true' | 'false'
triggeraria-expanded'true' | 'false'
triggeraria-haspopup'menu'
triggerrole'menuitem'
contentaria-hidden!isOpen || undefined
contentaria-labelledbytrigger 部件的 id
contentrole'menu'
itemaria-disabled'true' | 'false'
itemrole'menuitem'
item-indicatoraria-hidden'true'
item-shortcutaria-hidden'true'
separatoraria-orientation'horizontal'
separatorrole'separator'
grouparia-labelledbygroup-label 部件的 id
grouprole'group'
arrowaria-hidden'true'

样式参考 ​

皮肤 ​

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

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

数据属性 ​

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

部件属性值
rootdata-disabled''(条件成立时才出现)
rootdata-orientationprops.orientation
rootdata-sizeprops.size
rootdata-state'open' | 'closed'
rootdata-toneprops.tone
triggerdata-disabled''(条件成立时才出现)
triggerdata-in-path''(条件成立时才出现)
triggerdata-pressed''(条件成立时才出现)
triggerdata-state'open' | 'closed'
triggerdata-xh-collection-context'nav'
triggerdata-xh-collection-item''
triggerdata-xh-collection-sizeprops.size
positionerdata-hidden''(条件成立时才出现)
positionerdata-placement定位引擎算出的实际落位 | undefined
positionerdata-positioned''(条件成立时才出现)
positionerdata-sizeprops.size
positionerdata-state'open' | 'closed'
positionerdata-toneprops.tone
contentdata-instant''(条件成立时才出现)
contentdata-placement定位引擎算出的实际落位 | undefined
contentdata-state'open' | 'closed'
contentdata-xh-material'frosted'
itemdata-disabled''(条件成立时才出现)
itemdata-highlighted''(条件成立时才出现)
itemdata-pressed''(条件成立时才出现)
itemdata-toneitemMetaOf.get(item.value)?.tone
itemdata-xh-collection-context'overlay'
itemdata-xh-collection-item''
itemdata-xh-collection-sizeprops.size
item-textdata-disabled''(条件成立时才出现)
item-textdata-highlighted''(条件成立时才出现)
item-textdata-xh-collection-slot'text'
item-indicatordata-disabled''(条件成立时才出现)
item-indicatordata-highlighted''(条件成立时才出现)
item-indicatordata-xh-collection-slot'prefix'
item-descriptiondata-disabled''(条件成立时才出现)
item-descriptiondata-highlighted''(条件成立时才出现)
item-descriptiondata-xh-collection-slot'description'
item-shortcutdata-disabled''(条件成立时才出现)
item-shortcutdata-highlighted''(条件成立时才出现)
item-shortcutdata-xh-collection-slot'shortcut'
item-suffixdata-disabled''(条件成立时才出现)
item-suffixdata-highlighted''(条件成立时才出现)
item-suffixdata-xh-collection-slot'suffix'
separatordata-xh-collection-separator''
arrowdata-placement定位引擎算出的实际落位

CSS 变量 ​

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

变量部件CSS 属性状态默认来源说明
--xh-menubar-arrow-sizearrow--xh-_overlay-arrow-sizedefault--xh-overlay-arrow-sizemenubar 的 arrow 部件 --xh-_overlay-arrow-size 覆盖槽。
--xh-menubar-backdropcontent-webkit-backdrop-filter
backdrop-filter
xh-material=frosted--xh-_material-backdropmenubar 的 content 部件 -webkit-backdrop-filter、backdrop-filter 覆盖槽。
--xh-menubar-bgrootbackgrounddefaulttransparentmenubar 的 root 部件 background 覆盖槽。
--xh-menubar-borderarrow
content
borderdefault
not([data-xh-action-control])
xh-material=frosted
--xh-_material-border
--xh-material-frosted-border
menubar 的 arrow、content 部件 border 覆盖槽。
--xh-menubar-content-bgarrow
content
backgrounddefault
not([data-xh-action-control])
xh-material=frosted
--xh-_material-bg
--xh-material-frosted-bg
menubar 的 arrow、content 部件 background 覆盖槽。
--xh-menubar-content-fgcontentcolornot([data-xh-action-control])
xh-material=frosted
--xh-_material-fgmenubar 的 content 部件 color 覆盖槽。
--xh-menubar-content-gapcontentgapdefault--xh-list-option-gapmenubar 的 content 部件 gap 覆盖槽。
--xh-menubar-content-pxcontentpadding-inlinedefault--xh-surface-pad-xsmenubar 的 content 部件 padding-inline 覆盖槽。
--xh-menubar-content-pycontentpadding-blockdefault--xh-surface-pad-xsmenubar 的 content 部件 padding-block 覆盖槽。
--xh-menubar-content-radiuscontentborder-radiusdefault--xh-shape-overlaymenubar 的 content 部件 border-radius 覆盖槽。
--xh-menubar-content-shadowcontentbox-shadownot([data-xh-action-control])
xh-material=frosted
--xh-_material-shadowmenubar 的 content 部件 box-shadow 覆盖槽。
--xh-menubar-fgrootcolordefault--xh-fg-defaultmenubar 的 root 部件 color 覆盖槽。
--xh-menubar-gaprootgapdefault--xh-space-1menubar 的 root 部件 gap 覆盖槽。
--xh-menubar-group-gapgroupgapdefault--xh-list-option-gapmenubar 的 group 部件 gap 覆盖槽。
--xh-menubar-group-label-fggroup-labelcolordefault--xh-material-frosted-fg-mutedmenubar 的 group-label 部件 color 覆盖槽。
--xh-menubar-group-label-font-sizegroup-labelfont-sizedefault--xh-text-caption-sizemenubar 的 group-label 部件 font-size 覆盖槽。
--xh-menubar-group-label-font-weightgroup-labelfont-weightdefault--xh-font-weight-mediummenubar 的 group-label 部件 font-weight 覆盖槽。
--xh-menubar-group-label-pxgroup-labelpadding-inlinedefault--xh-_menubar-item-pxmenubar 的 group-label 部件 padding-inline 覆盖槽。
--xh-menubar-group-label-pygroup-labelpadding-blockdefault--xh-space-1menubar 的 group-label 部件 padding-block 覆盖槽。
--xh-menubar-highlightcontentbackgroundnot([data-xh-action-control])
xh-material=frosted
--xh-_material-highlightmenubar 的 content 部件 background 覆盖槽。
--xh-menubar-icon-sizepositioner
root
--xh-icon-sizeis([data-part='root'], [data-part='positioner'])
size=lg
size=sm
--xh-glyph-size-lg
--xh-glyph-size-md
--xh-glyph-size-sm
menubar 的 positioner、root 部件 --xh-icon-size 覆盖槽。
--xh-menubar-item-bg-activeitembackground-colorin-path
xh-collection-context=nav
--xh-bg-subtlemenubar 的 item 部件 background-color 覆盖槽。
--xh-menubar-item-bg-hoveritembackground-colordisabled
error
highlighted
hover
is(:focus-visible, [data-highlighted])
not([aria-disabled='true'], [data-disabled], [aria-busy='true'], [data-error])
xh-collection-context=nav
--xh-bg-subtlemenubar 的 item 部件 background-color 覆盖槽。
--xh-menubar-item-bg-presseditembackground-colordisabled
error
is(:active, [data-pressed])
not([aria-disabled='true'], [data-disabled], [aria-busy='true'], [data-error])
pressed
xh-collection-context=nav
--xh-bg-subtle-hovermenubar 的 item 部件 background-color 覆盖槽。
--xh-menubar-item-description-fgitem-descriptioncolordefault--xh-material-frosted-fg-mutedmenubar 的 item-description 部件 color 覆盖槽。
--xh-menubar-item-description-font-sizeitem-descriptionfont-sizedefault--xh-text-caption-sizemenubar 的 item-description 部件 font-size 覆盖槽。
--xh-menubar-item-fgitemcolordefault
disabled
error
highlighted
hover
in-path
is(:active, [data-pressed])
is(:focus-visible, [data-highlighted])
not([aria-disabled='true'], [data-disabled], [aria-busy='true'], [data-error])
pressed
xh-collection-context=nav
--xh-material-frosted-fgmenubar 的 item 部件 color 覆盖槽。
--xh-menubar-item-font-sizeitemfont-sizedefault--xh-_menubar-font-sizemenubar 的 item 部件 font-size 覆盖槽。
--xh-menubar-item-gapitemgapdefault--xh-_menubar-item-gapmenubar 的 item 部件 gap 覆盖槽。
--xh-menubar-item-indicator-fgitem-indicatorcolordefault--xh-_tonemenubar 的 item-indicator 部件 color 覆盖槽。
--xh-menubar-item-indicator-sizeitem-indicator--xh-icon-size
block-size
inline-size
default--xh-control-indicator-sizemenubar 的 item-indicator 部件 --xh-icon-size、block-size、inline-size 覆盖槽。
--xh-menubar-item-leadingitemline-heightdefault--xh-leading-normalmenubar 的 item 部件 line-height 覆盖槽。
--xh-menubar-item-pxitempadding-inlinedefault--xh-_menubar-item-pxmenubar 的 item 部件 padding-inline 覆盖槽。
--xh-menubar-item-pyitempadding-blockdefault--xh-_menubar-item-pymenubar 的 item 部件 padding-block 覆盖槽。
--xh-menubar-item-radiusitemborder-radiusdefault--xh-shape-controlmenubar 的 item 部件 border-radius 覆盖槽。
--xh-menubar-layerpositionerz-indexdefault--xh-_layermenubar 的 positioner 部件 z-index 覆盖槽。
--xh-menubar-max-hcontentmax-block-sizedefault--xh-overlay-menu-max-hmenubar 的 content 部件 max-block-size 覆盖槽。
--xh-menubar-max-wcontentmax-inline-sizedefault--xh-overlay-max-wmenubar 的 content 部件 max-inline-size 覆盖槽。
--xh-menubar-min-wcontentmin-inline-sizedefault--xh-overlay-menu-min-wmenubar 的 content 部件 min-inline-size 覆盖槽。
--xh-menubar-pxrootpadding-inlinedefault--xh-space-1menubar 的 root 部件 padding-inline 覆盖槽。
--xh-menubar-pyrootpadding-blockdefault--xh-space-1menubar 的 root 部件 padding-block 覆盖槽。
--xh-menubar-radiusrootborder-radiusdefault--xh-shape-controlmenubar 的 root 部件 border-radius 覆盖槽。
--xh-menubar-separator-colorseparatorbackgrounddefault--xh-material-frosted-separatormenubar 的 separator 部件 background 覆盖槽。
--xh-menubar-separator-myseparatormargin-blockdefault--xh-space-0_5menubar 的 separator 部件 margin-block 覆盖槽。
--xh-menubar-separator-radiusseparatorborder-radiusdefault--xh-shape-pillmenubar 的 separator 部件 border-radius 覆盖槽。
--xh-menubar-separator-thicknessseparatorblock-sizedefault--xh-stroke-thinmenubar 的 separator 部件 block-size 覆盖槽。
--xh-menubar-submenu-indicator-fgitembackground-colordefault--xh-material-frosted-fg-mutedmenubar 的 item 部件 background-color 覆盖槽。
--xh-menubar-submenu-indicator-sizeitemblock-size
inline-size
default--xh-control-indicator-sizemenubar 的 item 部件 block-size、inline-size 覆盖槽。
--xh-menubar-trigger-bg-activetriggerbackground-colorin-path
xh-collection-context=nav
--xh-bg-subtlemenubar 的 trigger 部件 background-color 覆盖槽。
--xh-menubar-trigger-bg-hovertriggerbackground-colordisabled
error
hover
not([aria-disabled='true'], [data-disabled], [aria-busy='true'], [data-error])
xh-collection-context=nav
--xh-bg-subtlemenubar 的 trigger 部件 background-color 覆盖槽。
--xh-menubar-trigger-bg-pressedtriggerbackground-colordisabled
error
is(:active, [data-pressed])
not([aria-disabled='true'], [data-disabled], [aria-busy='true'], [data-error])
pressed
xh-collection-context=nav
--xh-bg-subtle-hovermenubar 的 trigger 部件 background-color 覆盖槽。
--xh-menubar-trigger-fgtriggercolordefault
xh-collection-context=nav
--xh-fg-defaultmenubar 的 trigger 部件 color 覆盖槽。
--xh-menubar-trigger-font-sizetriggerfont-sizedefault--xh-_menubar-font-sizemenubar 的 trigger 部件 font-size 覆盖槽。
--xh-menubar-trigger-gaptriggergapdefault--xh-control-gap-smmenubar 的 trigger 部件 gap 覆盖槽。
--xh-menubar-trigger-pxtriggerpadding-inlinedefault--xh-_menubar-trigger-pxmenubar 的 trigger 部件 padding-inline 覆盖槽。
--xh-menubar-trigger-pytriggerpadding-blockdefault--xh-_menubar-trigger-pymenubar 的 trigger 部件 padding-block 覆盖槽。
--xh-menubar-trigger-radiustriggerborder-radiusdefault--xh-shape-controlmenubar 的 trigger 部件 border-radius 覆盖槽。

动效 ​

动效角色:按压 · 状态 · 出现(锚定列表)(见动效规范)。

共享关键帧 xh-overlay-slide-in · xh-overlay-slide-out 由 family/motion.css 提供,皮肤 @import 它,单独引入仍成立。时长与缓动读动效令牌,改令牌即改全局节奏。

皮肤之外还有一段:退场由适配器的退场闸门把关,动画播完才真收起。

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

RTL ​

皮肤用逻辑属性排布(inline-start 一族),dir="rtl" 下自动镜像;另有按 dir 分支的规则。

Released under The MIT License