|
3 | 3 | font-size: 16px; |
4 | 4 | } |
5 | 5 | } |
| 6 | + |
| 7 | +// ============================================ |
| 8 | +// 沉浸式阅读模式 - 隐藏导航栏、侧边栏和目录 |
| 9 | +// ============================================ |
| 10 | + |
| 11 | +// 过渡动画 |
| 12 | +.vp-navbar, |
| 13 | +.vp-sidebar, |
| 14 | +.vp-page, |
| 15 | +.theme-container .vp-page { |
| 16 | + transition: |
| 17 | + transform 0.3s ease, |
| 18 | + opacity 0.3s ease, |
| 19 | + margin 0.3s ease, |
| 20 | + padding 0.3s ease, |
| 21 | + width 0.3s ease; |
| 22 | +} |
| 23 | + |
| 24 | +// 隐藏布局模式 |
| 25 | +html.layout-hidden { |
| 26 | + // 隐藏顶部导航栏 |
| 27 | + .vp-navbar { |
| 28 | + transform: translateY(-100%) !important; |
| 29 | + opacity: 0 !important; |
| 30 | + pointer-events: none !important; |
| 31 | + } |
| 32 | + |
| 33 | + // 隐藏左侧边栏 |
| 34 | + .vp-sidebar { |
| 35 | + transform: translateX(-100%) !important; |
| 36 | + opacity: 0 !important; |
| 37 | + pointer-events: none !important; |
| 38 | + width: 0 !important; |
| 39 | + } |
| 40 | + |
| 41 | + // 侧边栏包装器 |
| 42 | + .vp-sidebar-wrapper, |
| 43 | + .sidebar-wrapper { |
| 44 | + width: 0 !important; |
| 45 | + min-width: 0 !important; |
| 46 | + padding: 0 !important; |
| 47 | + margin: 0 !important; |
| 48 | + } |
| 49 | + |
| 50 | + // 隐藏右侧目录 (TOC) |
| 51 | + .vp-toc-placeholder, |
| 52 | + .toc-wrapper, |
| 53 | + .vp-toc, |
| 54 | + aside.vp-toc, |
| 55 | + .toc { |
| 56 | + display: none !important; |
| 57 | + width: 0 !important; |
| 58 | + } |
| 59 | + |
| 60 | + // 主容器调整 - 移除左侧 padding/margin |
| 61 | + .theme-container { |
| 62 | + padding-left: 0 !important; |
| 63 | + padding-right: 0 !important; |
| 64 | + |
| 65 | + .vp-page { |
| 66 | + padding-left: 2rem !important; |
| 67 | + padding-right: 2rem !important; |
| 68 | + padding-top: 1rem !important; |
| 69 | + margin-left: 0 !important; |
| 70 | + max-width: 100% !important; |
| 71 | + width: 100% !important; |
| 72 | + } |
| 73 | + } |
| 74 | + |
| 75 | + // 主题内容区域调整 - 让内容更宽 |
| 76 | + .theme-hope-content, |
| 77 | + .vp-page-content, |
| 78 | + .vp-content { |
| 79 | + max-width: 100% !important; |
| 80 | + width: 100% !important; |
| 81 | + margin: 0 !important; |
| 82 | + padding: 1rem 2rem !important; |
| 83 | + } |
| 84 | + |
| 85 | + // 页面容器调整 |
| 86 | + .vp-page-container { |
| 87 | + padding-top: 1rem !important; |
| 88 | + padding-left: 0 !important; |
| 89 | + padding-right: 0 !important; |
| 90 | + max-width: 100% !important; |
| 91 | + } |
| 92 | + |
| 93 | + // 确保内容区域居中且宽度适中 |
| 94 | + .theme-container > main { |
| 95 | + margin-left: 0 !important; |
| 96 | + padding-left: 0 !important; |
| 97 | + max-width: 100% !important; |
| 98 | + } |
| 99 | + |
| 100 | + // 响应式调整 |
| 101 | + @media (min-width: 960px) { |
| 102 | + .theme-container .vp-page { |
| 103 | + margin-left: 0 !important; |
| 104 | + padding-left: 3rem !important; |
| 105 | + padding-right: 3rem !important; |
| 106 | + } |
| 107 | + |
| 108 | + .theme-hope-content, |
| 109 | + .vp-page-content, |
| 110 | + .vp-content { |
| 111 | + max-width: 100% !important; |
| 112 | + padding: 1rem 2rem !important; |
| 113 | + } |
| 114 | + } |
| 115 | + |
| 116 | + @media (min-width: 1440px) { |
| 117 | + .theme-container .vp-page { |
| 118 | + margin-left: 0 !important; |
| 119 | + padding-left: 4rem !important; |
| 120 | + padding-right: 4rem !important; |
| 121 | + } |
| 122 | + |
| 123 | + .theme-hope-content, |
| 124 | + .vp-page-content, |
| 125 | + .vp-content { |
| 126 | + max-width: 100% !important; |
| 127 | + padding: 1rem 3rem !important; |
| 128 | + } |
| 129 | + } |
| 130 | +} |
0 commit comments