Skip to content

Build your personal knowledge base with Trilium Notes

feat(breadcrumb_row): improve badge fit on constrained width

Elian Doranbd81db41172a
diff --git a/apps/client/src/widgets/Breadcrumb.css b/apps/client/src/widgets/Breadcrumb.css
index 5f3bc886bb..9d702beffe 100644
--- a/apps/client/src/widgets/Breadcrumb.css
+++ b/apps/client/src/widgets/Breadcrumb.css
@@ -4,6 +4,37 @@
min-height: 30px;
align-items: center;
padding: 10px;
+ container-type: inline-size;
+
+ @container (max-width: 500px) {
+ .breadcrumb-badges {
+ flex-shrink: 0;
+
+ >* {
+ flex-shrink: 0;
+ width: 18px;
+ }
+
+ .dropdown {
+ button {
+ flex-shrink: 0;
+ }
+ }
+
+ .breadcrumb-badge {
+ flex-shrink: 0;
+ padding: 0 2px;
+
+ >* {
+ text-overflow: clip;
+ }
+
+ .text {
+ display: none;
+ }
+ }
+ }
+ }
}
body.experimental-feature-new-layout .breadcrumb-row {
diff --git a/apps/client/src/widgets/BreadcrumbBadges.css b/apps/client/src/widgets/BreadcrumbBadges.css
index 41116aa1e6..7d6405159d 100644
--- a/apps/client/src/widgets/BreadcrumbBadges.css
+++ b/apps/client/src/widgets/BreadcrumbBadges.css
@@ -16,7 +16,7 @@
padding: 2px 6px;
border-radius: var(--badge-radius);
font-size: 0.75em;
- background-color: var(--color, var(--badge-background-color));
+ background-color: var(--color, transparent);
color: white;
min-width: 0;
flex-shrink: 1;
diff --git a/apps/client/src/widgets/BreadcrumbBadges.tsx b/apps/client/src/widgets/BreadcrumbBadges.tsx
index 35cda87dde..57377167ee 100644
--- a/apps/client/src/widgets/BreadcrumbBadges.tsx
+++ b/apps/client/src/widgets/BreadcrumbBadges.tsx
@@ -103,7 +103,7 @@ function Badge({ icon, className, text, tooltip, onClick, href }: BadgeProps) {
const content = <>
{icon && <><Icon icon={icon} />&nbsp;</>}
- {text}
+ <span class="text">{text}</span>
</>;
return (