Skip to content

Commit

Permalink
UI: Prevent shrink on sidebar icons by default
Browse files Browse the repository at this point in the history
  • Loading branch information
fuma-nama committed Jan 19, 2025
1 parent 777188b commit 900eb6c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/orange-lemons-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fumadocs-ui': patch
---

Prevent shrink on sidebar icons by default
1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ui/src/layouts/docs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function DocsLayout({
>
{collapsible ? (
<SidebarCollapseTrigger
className="fixed bottom-3 z-30 data-[collapsed=false]:hidden max-md:hidden"
className="fixed bottom-3 z-30 backdrop-blur-lg data-[collapsed=false]:hidden max-md:hidden"
style={{
insetInlineStart: 'calc(var(--fd-layout-offset) + 0.5rem)',
}}
Expand Down
5 changes: 2 additions & 3 deletions packages/ui/src/layouts/docs/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ interface InternalContext {
}

const itemVariants = cva(
'flex flex-row items-center gap-2 rounded-md p-2 text-fd-muted-foreground [overflow-wrap:anywhere] md:py-1.5 [&_svg]:size-4',
'flex flex-row items-center gap-2 rounded-md p-2 text-start text-fd-muted-foreground [overflow-wrap:anywhere] md:py-1.5 [&_svg]:size-4 [&_svg]:shrink-0',
{
variants: {
active: {
true: 'bg-fd-primary/10 font-medium text-fd-primary',
false:
'transition-colors duration-100 hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none',
'transition-colors hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none',
},
},
},
Expand Down Expand Up @@ -358,7 +358,6 @@ export function SidebarCollapseTrigger(
color: 'ghost',
size: 'icon',
}),
'backdrop-blur-lg',
props.className,
)}
onClick={() => {
Expand Down

0 comments on commit 900eb6c

Please sign in to comment.