Chevron-shaped breadcrumb steps that nest into each other; hovering one floods it with color from the left while the current page stays solid. Each step is a clip-path polygon.
Also known as: arrow breadcrumbs css, chevron breadcrumb hover, breadcrumb navigation animation.
<nav class="hfx-nav-breadcrumb-arrows" aria-label="Breadcrumb"> <a href="#">Home</a> <a href="#">Docs</a> <a href="#">Guides</a> <a href="#" aria-current="page">Motion</a> </nav>
.hfx-nav-breadcrumb-arrows {
--c: var(--hfx-color, #3b82f6);
display: flex;
align-items: center;
font: 600 var(--hfx-size, 16px)/1.2 system-ui, sans-serif;
}
.hfx-nav-breadcrumb-arrows a {
--tip: 0.7em;
margin-left: calc(0.18em - var(--tip));
padding: 0.65em 1em 0.65em calc(0.9em + var(--tip));
color: inherit;
text-decoration: none;
background:
linear-gradient(var(--c) 0 0) 0 0 / 0 100% no-repeat,
color-mix(in srgb, var(--c) 14%, transparent);
clip-path: polygon(0 0, calc(100% - var(--tip)) 0, 100% 50%, calc(100% - var(--tip)) 100%, 0 100%, var(--tip) 50%);
transition: background-size 0.35s cubic-bezier(0.65, 0, 0.35, 1), color 0.25s ease;
}
.hfx-nav-breadcrumb-arrows a:first-child {
margin-left: 0;
padding-left: 1.1em;
clip-path: polygon(0 0, calc(100% - var(--tip)) 0, 100% 50%, calc(100% - var(--tip)) 100%, 0 100%);
}
.hfx-nav-breadcrumb-arrows a:is([aria-current="page"], :hover, :focus-visible) {
background-size: 100% 100%;
color: #fff;
}
@media (prefers-reduced-motion: reduce) {
.hfx-nav-breadcrumb-arrows, .hfx-nav-breadcrumb-arrows *, .hfx-nav-breadcrumb-arrows::before, .hfx-nav-breadcrumb-arrows::after, .hfx-nav-breadcrumb-arrows *::before, .hfx-nav-breadcrumb-arrows *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}--hfx-color on the element or a parent.
Currently previewing #3b82f6.--hfx-size. Every other dimension is in
em, so the whole thing scales together. Currently previewing 16px.transition or animation
shorthand. Staggered delays are relative, so they keep their rhythm.