UI: Prevent shrink on sidebar icons by default

This commit is contained in:
Fuma Nama
2025-01-19 09:19:44 +08:00
parent 777188b028
commit 900eb6ca88
4 changed files with 9 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-ui': patch
---
Prevent shrink on sidebar icons by default
+1
View File
@@ -1,6 +1,7 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
+1 -1
View File
@@ -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)',
}}
+2 -3
View File
@@ -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',
},
},
},
@@ -358,7 +358,6 @@ export function SidebarCollapseTrigger(
color: 'ghost',
size: 'icon',
}),
'backdrop-blur-lg',
props.className,
)}
onClick={() => {