Skip to content

Commit

Permalink
Allow last crumb to shrink if all crumbs collapsed
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <[email protected]>
  • Loading branch information
raimund-schluessler committed Mar 22, 2021
1 parent 5a32700 commit c5a8c60
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/components/Breadcrumb/Breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ export default {
height: $clickable-area;
padding: 0;
&:last-child {
max-width: 210px;
a {
flex-shrink: 1;
}
}
&::before {
display: flex;
align-items: center;
Expand All @@ -236,6 +244,10 @@ export default {
padding-right: 2px;
}
> a, > span {
max-width: 100%;
}
a {
align-items: center;
display: inline-flex;
Expand Down
7 changes: 6 additions & 1 deletion src/components/Breadcrumbs/Breadcrumbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ export default {
: []
this.addCrumbs(crumbs, crumbs2, crumbs1.length)
return createElement('div', { class: 'breadcrumb', ref: 'container' }, crumbs)
return createElement('div', { class: ['breadcrumb', { collapsed: (this.hiddenCrumbs.length === breadcrumbs.length - 2) }], ref: 'container' }, crumbs)
},
}
</script>
Expand All @@ -512,6 +512,11 @@ export default {
width: 100%;
flex-grow: 1;
&.collapsed .crumb:last-child {
min-width: 100px;
flex-shrink: 1;
}
.crumb--hovered{
background-color: var(--color-primary-light);
}
Expand Down

0 comments on commit c5a8c60

Please sign in to comment.