Skip to content

Commit 59787dc

Browse files
author
catlog22
committed
feat: enhance responsive design for documentation layout; adjust margins and paddings for better content scaling
1 parent d716902 commit 59787dc

3 files changed

Lines changed: 90 additions & 6 deletions

File tree

.claude/CLAUDE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ Available CLI endpoints are dynamically defined by the config file
2020
- **TaskOutput usage**: Only use `TaskOutput({ task_id: "xxx", block: false })` + sleep loop to poll completion status. NEVER read intermediate output during agent/CLI execution - wait for final result only
2121

2222
### CLI Tool Calls (ccw cli)
23-
- **Default: Use Bash `run_in_background: true`** - Unless otherwise specified, always execute CLI calls in background using Bash tool's background mode:
23+
- **Default**: CLI calls (`ccw cli`) default to background execution (`run_in_background: true`):
2424
```
2525
Bash({
2626
command: "ccw cli -p '...' --tool gemini",
2727
run_in_background: true // Bash tool parameter, not ccw cli parameter
2828
})
2929
```
30-
- **After CLI call**: Stop output immediately - let CLI execute in background. **DO NOT use TaskOutput polling** - wait for hook callback to receive results
30+
- **CRITICAL — Agent-specific instructions ALWAYS override this default.** If an agent's definition file (`.claude/agents/*.md`) specifies `run_in_background: false`, that instruction takes highest priority. Subagents (Task tool agents) CANNOT receive hook callbacks, so they MUST use `run_in_background: false` for CLI calls that produce required results.
31+
- **After CLI call (main conversation only)**: Stop output immediately - let CLI execute in background. **DO NOT use TaskOutput polling** - wait for hook callback to receive results
3132

3233
### CLI Analysis Calls
3334
- **Wait for results**: MUST wait for CLI analysis to complete before taking any write action. Do NOT proceed with fixes while analysis is running

docs/.vitepress/theme/styles/custom.css

Lines changed: 85 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
font-size: var(--vp-font-size-base);
233233
line-height: var(--vp-line-height-relaxed);
234234
margin: var(--vp-spacing-5) 0;
235-
max-width: var(--vp-prose-width);
235+
max-width: 100%;
236236
}
237237

238238
/* Lists with proper spacing */
@@ -242,7 +242,7 @@
242242
line-height: var(--vp-line-height-relaxed);
243243
margin: var(--vp-spacing-5) 0;
244244
padding-left: var(--vp-spacing-6);
245-
max-width: var(--vp-prose-width);
245+
max-width: 100%;
246246
}
247247

248248
.vp-doc li {
@@ -837,3 +837,86 @@ textarea:focus-visible {
837837
padding: 0 !important;
838838
}
839839
}
840+
841+
/*
842+
* ===================================================================
843+
* 智能响应式内容宽度方案 (Intelligent Responsive Content Width)
844+
* ===================================================================
845+
* 目的: 根据视口宽度动态调整内容区域占比,优化空间利用。
846+
* 原理: 使用rem单位的padding,在不同视口宽度下提供合适的留白。
847+
* 窄屏使用较小padding,超宽屏使用较大padding。
848+
*/
849+
850+
/* 步骤1: 在所有桌面视图下,让.container可以填满父级空间 */
851+
@media (min-width: 1024px) {
852+
.VPDoc.has-aside .container {
853+
max-width: none !important;
854+
width: 100% !important;
855+
margin: 0 !important;
856+
padding: 0 var(--vp-spacing-8) !important;
857+
}
858+
859+
.VPContent.has-sidebar {
860+
margin-left: var(--vp-sidebar-width) !important;
861+
margin-right: var(--vp-toc-width) !important;
862+
width: calc(100vw - var(--vp-sidebar-width) - var(--vp-toc-width)) !important;
863+
box-sizing: border-box;
864+
}
865+
}
866+
867+
/* 窄屏 (1024px - 1439px): 使用2rem padding */
868+
@media (min-width: 1024px) and (max-width: 1439px) {
869+
.VPContent.has-sidebar {
870+
padding-left: 2rem !important;
871+
padding-right: 2rem !important;
872+
}
873+
}
874+
875+
/* 标准宽屏 (1440px - 1919px): 使用3rem padding */
876+
@media (min-width: 1440px) and (max-width: 1919px) {
877+
.VPContent.has-sidebar {
878+
padding-left: 3rem !important;
879+
padding-right: 3rem !important;
880+
}
881+
}
882+
883+
/* 超宽屏 (>= 1920px): 使用5rem padding */
884+
@media (min-width: 1920px) {
885+
.VPContent.has-sidebar {
886+
padding-left: 5rem !important;
887+
padding-right: 5rem !important;
888+
}
889+
}
890+
891+
/* ============================================
892+
* Widen Doc Content to Fill Container
893+
* ============================================ */
894+
/*
895+
* Overrides VitePress's default readability width limit for .vp-doc
896+
* and .content-container on desktop layouts, allowing content to use
897+
* the full available space defined by the responsive padding in the
898+
* "Intelligent Responsive Content Width" section.
899+
*/
900+
@media (min-width: 1024px) {
901+
/* Expand .content to fill available space */
902+
.VPDoc.has-aside .container .content {
903+
flex-grow: 1 !important;
904+
max-width: none !important;
905+
}
906+
907+
/* Use multiple selectors to increase specificity and override scoped styles */
908+
.VPDoc.has-aside .container .content-container,
909+
.VPDoc.has-aside .content-container[class],
910+
.content-container {
911+
max-width: none !important;
912+
width: 100% !important;
913+
min-width: 100% !important;
914+
flex-grow: 1 !important;
915+
flex-basis: 100% !important;
916+
}
917+
918+
.vp-doc {
919+
max-width: 100% !important;
920+
width: 100% !important;
921+
}
922+
}

docs/.vitepress/theme/styles/mobile.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,8 @@
692692
/* Ensure content has proper margin-left to clear the sidebar */
693693
.VPContent.has-sidebar {
694694
margin-left: var(--vp-sidebar-width) !important;
695-
margin-right: calc(var(--vp-toc-width) + 3rem) !important; /* 48px = 3rem */
696-
padding: var(--vp-spacing-8) var(--vp-spacing-12) !important;
695+
margin-right: var(--vp-toc-width) !important;
696+
/* padding moved to custom.css for responsive width control */
697697
}
698698

699699
/* Adjust doc container - allow content to scale with zoom */

0 commit comments

Comments
 (0)