diff --git a/.vitepress/theme/components/CustomHeader.vue b/.vitepress/theme/components/CustomHeader.vue index 3ed238b..d78e487 100644 --- a/.vitepress/theme/components/CustomHeader.vue +++ b/.vitepress/theme/components/CustomHeader.vue @@ -577,6 +577,10 @@ watch( .logo-icon { height: 32px; + /* 避免全局 img { max-width: 100% } 导致 logo 在窄屏时被压缩 */ + max-width: none; + /* 保证在某些布局下不会被最小宽度约束影响 */ + min-width: 0; } .logo-text { @@ -749,6 +753,12 @@ watch( } @media (max-width: 979px) { + /* 移动端适配:窄屏时使用较小的 logo,避免溢出 */ + .mb-logo .logo-icon { + width: 160px; + height: 26px; + max-width: none; + } .header-top { display: none; }