Skip to content

refactor: breadcrumbs base styles and themes#11868

Draft
jouni wants to merge 7 commits into
mainfrom
fix/breadcrumb-styles-and-themes
Draft

refactor: breadcrumbs base styles and themes#11868
jouni wants to merge 7 commits into
mainfrom
fix/breadcrumb-styles-and-themes

Conversation

@jouni
Copy link
Copy Markdown
Member

@jouni jouni commented May 28, 2026

This is how I would want the component styles to be. Not sure what we need to change in the specs to get closer to this.

Changes on a high level

  • Add padding around items, so that they gain a bigger click target, and that the focus outline is offset from the text.
  • Use baseline alignment, so that in case of the text in an item doesn't fit the width and wraps, the any prefix icon and other items in the breadcrumbs are still aligned on the top/first line.
    • Use the same white-space character for the icon pseudo elements, as in other similar cases, so that the icon element also sits on the baseline.
  • Use a mask-image for the overflow button ellipsis icon, instead of the font-dependent character.
  • Don't clip/hide overflow, to avoid padding + negative margin to keep focus outlines visible. Ensure items still collapse to the overflow menu by setting width, min-width and max-width on the host and the internal list.
  • Always use the pointer cursor for links, as that’s the expectation for links on the web.
  • Remove the link underline by default in base styles, as both Lumo and Aura want that removed.
  • Treat disabled items visually the same as items without a path (text-only items), to keep them legible.
  • Minor adjustments for iOS (prevent default tap highlight color).
  • Add a collection of --vaadin-breadcrumbs-* custom properties for easier customization.
  • Aura and Lumo opt to use the secondary text color for the links by default, and offer a variant (accent and primary, respectively) for coloring the links, which makes it possible to distinguish between link and non-link items without interacting with them.
  • Add a built-in slash variant to base styles, which changes the default separator icon from a chevron to a slash.

@jouni jouni force-pushed the fix/breadcrumb-styles-and-themes branch 5 times, most recently from 9ed8205 to dee184f Compare May 29, 2026 12:22

:host([slot='overlay']) [part='link']:focus-visible {
border-radius: var(--vaadin-radius-m);
/* TODO shouldn't focus the first item when opened with the mouse or at least shouldn't apply the focus-ring attribute */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #11876 to solve this, PTAL.

@web-padawan web-padawan force-pushed the fix/breadcrumb-styles-and-themes branch 2 times, most recently from 16081ac to 95519ad Compare June 2, 2026 07:09
@web-padawan web-padawan force-pushed the fix/breadcrumb-styles-and-themes branch from 95519ad to d447d72 Compare June 2, 2026 07:10
Spec's CSS custom property tables align with the JSDoc on both elements:
nine container-level tokens (typography, color, gap, two mask-image
icons + size) and two item-level tokens (border radius, item gap). The
separator hook is `--vaadin-breadcrumbs-separator-icon` across spec
references; KDD #5, the overflow-separator bullet, and the item
separator-rendering bullet are updated accordingly. Added Discussion
entry explaining the token shape.
Copy link
Copy Markdown
Member

@web-padawan web-padawan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed an update to the spec to list new custom CSS properties, also fixed JSDoc.
I'll continue reviewing the actual implementation later and update specs if needed.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 2, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants