Angular 面包屑组件 | ng-hub-ui-breadcrumbs
Angular 面包屑组件,支持 Router 集成、自定义模板、RTL 以及灵活的样式 token。
样式
混入与样式
Override any of the `--hub-breadcrumb-*` design tokens in a single include. Every parameter is OPTIONAL and defaults to `null`: only the parameters you pass are emitted, so the rest keep the component's defaults. Token-based and self-contained (no Bootstrap dependencies).
Theming with hub-breadcrumb-theme
| 混入 | 参数 | 描述 |
|---|---|---|
| Theming | ||
hub-breadcrumb-theme() | $bg--hub-breadcrumb-bg$color--hub-breadcrumb-color$border-radius--hub-breadcrumb-border-radius$padding-x--hub-breadcrumb-padding-x$padding-y--hub-breadcrumb-padding-y$margin-bottom--hub-breadcrumb-margin-bottom$font-size--hub-breadcrumb-font-size$divider--hub-breadcrumb-divider$divider-flipped--hub-breadcrumb-divider-flipped$divider-color--hub-breadcrumb-divider-color$item-padding-x--hub-breadcrumb-item-padding-x$item-active-color--hub-breadcrumb-item-active-color$accent--hub-breadcrumb-accent$link-color--hub-breadcrumb-link-color$link-hover-color--hub-breadcrumb-link-hover-color$link-decoration--hub-breadcrumb-link-decoration$link-hover-decoration--hub-breadcrumb-link-hover-decoration | One-call theming for `<hub-breadcrumb>` |
CSS 变量
用 18 个 CSS 变量为每一个像素设置主题。在 :root 处覆盖它们,或将其限定到某个容器范围内。
Breadcrumbs
Design tokens read by this component. Override them on the host element (or any ancestor) to customize; every default falls back to the ng-hub-ui-ds layer.
| 变量 | 默认值 | 类型 | 描述 |
|---|---|---|---|
--hub-breadcrumb-padding-x | var(--hub-ref-space-3, 1rem) | length | 整个 breadcrumbs 组件周围的水平内边距 |
--hub-breadcrumb-padding-y | 0.25rem | length | 整个 breadcrumbs 组件周围的垂直内边距 |
--hub-breadcrumb-margin-bottom | var(--hub-ref-space-0, 0) | length | breadcrumbs 组件的底部外边距 |
--hub-breadcrumb-bg | var(--hub-sys-surface-page, transparent) | color | breadcrumbs 容器的背景颜色 |
--hub-breadcrumb-color | var(--hub-sys-text-primary, #212529) | color | Base text color of the breadcrumb list |
--hub-breadcrumb-font-size | inherit | length | breadcrumbs 文本的字号 |
--hub-breadcrumb-border-radius | var(--hub-ref-radius-md, 0.375rem) | length | breadcrumbs 容器的边框半径 |
--hub-breadcrumb-divider-color | var(--hub-sys-text-muted, #6c757d) | color | 分隔符的颜色 |
--hub-breadcrumb-divider | '>' | string | 用作 breadcrumbs 项之间分隔符的字符或符号 |
--hub-breadcrumb-divider-flipped | '<' | string | RTL 布局中使用的分隔符字符(方向反转) |
--hub-breadcrumb-item-padding-x | var(--hub-ref-space-1, 0.25rem) | length | 单个 breadcrumbs 项周围的水平内边距 |
--hub-breadcrumb-item-active-color | var(--hub-sys-text-muted, #6c757d) | color | 激活(当前)breadcrumbs 项的文本颜色 |
--hub-breadcrumb-accent | var(--hub-sys-color-primary, #0d6efd) | color | Semantic accent for the links — re-based per variant (default = link colour) |
--hub-breadcrumb-link-color | var(--hub-breadcrumb-accent) | color | 非激活 breadcrumbs 项(链接)的文本颜色 |
--hub-breadcrumb-link-hover-color | var(--hub-breadcrumb-accent-emphasis, var(--hub-sys-link-hover-color, #0a58ca)) | color | 悬停在 breadcrumbs 链接上时的文本颜色 |
--hub-breadcrumb-link-decoration | none | string | Text decoration of breadcrumb links |
--hub-breadcrumb-link-hover-decoration | underline | string | Text decoration of breadcrumb links on hover |
--hub-breadcrumb-max-item-width | 12rem | length | 启用截断时单个标签的最大宽度。 |
样式与主题
CSS 变量与主题化
使用 CSS 自定义属性对分隔符、颜色、间距和视觉外观进行完整的主题化控制。
示例:
CSS Variables Customization
Customize breadcrumbs appearance using CSS custom properties for complete theming
Breadcrumbs - CSS Variables Styling
Customization of dividers, colors, and spacing through CSS variables
Custom Divider
Custom Colors (via CSS class)
Spacing & Radius
代码
代码
导入:
模板:
组件: