Skip to content

feat: modify the style of the prompt component#97

Open
wuyiping0628 wants to merge 1 commit intodevfrom
wyp/tips-0331
Open

feat: modify the style of the prompt component#97
wuyiping0628 wants to merge 1 commit intodevfrom
wyp/tips-0331

Conversation

@wuyiping0628
Copy link
Copy Markdown
Collaborator

@wuyiping0628 wuyiping0628 commented Mar 31, 2026

Summary by CodeRabbit

  • Style
    • Improved spacing and alignment of custom content blocks in documentation, including better indentation for lists and content within info, warning, danger, and tip boxes.
    • Enhanced visual layout behavior for custom block icons and markers for improved readability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

Walkthrough

VitePress theme stylesheet updated to modify custom block layout behavior. Flexbox display removed from custom blocks, pseudo-element changed from inline-block to float positioning, and left margins added to ordered lists and block content within custom block variants.

Changes

Cohort / File(s) Summary
VitePress Theme Styling
.vitepress/theme/style.css
Modified custom block layout by removing flexbox display, changing pseudo-element positioning from display: inline-block to float: left, and adding margin-left: 32px indentation to ordered lists and .custom-block-content within info, warning, danger, and tip block variants.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A dash of CSS, a shift in the flow,
Floats now guide where icons will go,
Margins align the ordered array,
Custom blocks dance in a new, neater way,
Layout reborn, with spacing so bright!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'feat: modify the style of the prompt component' is somewhat vague and doesn't clearly convey the specific styling changes made, such as layout modifications and indentation adjustments for custom block elements. Consider a more specific title that describes the actual changes, such as 'feat: adjust custom block layout and indentation styles' or 'feat: refactor custom block styling with margin adjustments'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wyp/tips-0331

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.vitepress/theme/style.css:
- Around line 500-508: The rules for list indentation double-apply because both
the selectors ".vp-doc .custom-block.info ol, .vp-doc .custom-block.warning ol,
.vp-doc .custom-block.danger ol, .vp-doc .custom-block.tip ol" and ".vp-doc
.custom-block .custom-block-content" add margin-left; remove the explicit ol
selector rules and keep the 32px margin only on ".vp-doc .custom-block
.custom-block-content", then add a reset for lists inside that container (reset
ol and ul margin-left to 0 inside ".vp-doc .custom-block .custom-block-content")
so nested lists do not accumulate indentation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7978c001-4d3d-4feb-b7b6-238c2cc7e9ea

📥 Commits

Reviewing files that changed from the base of the PR and between a6ea9d2 and 412cb1a.

📒 Files selected for processing (1)
  • .vitepress/theme/style.css

Comment on lines +500 to +508
.vp-doc .custom-block.info ol,
.vp-doc .custom-block.warning ol,
.vp-doc .custom-block.danger ol,
.vp-doc .custom-block.tip ol {
margin-left: 32px;
}
.vp-doc .custom-block .custom-block-content {
margin-left: 32px;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

In VitePress v1.x, what is the default HTML structure for markdown custom containers (info/warning/danger/tip)? Specifically, are list elements typically wrapped by a .custom-block-content container?

💡 Result:

In VitePress v1.x, the default HTML structure for markdown custom containers (info, warning, danger, tip) is a div with class "custom-block" (and a type-specific subclass like "custom-block-info"), containing a div.custom-block-title with the title (e.g., "INFO") and a div.custom-block-content wrapping the container's content. List elements (ul/ol/li) within custom containers are typically wrapped by the .custom-block-content div, as it contains all the parsed markdown content from the ::: ... ::: block.

Citations:


🏁 Script executed:

cat -n .vitepress/theme/style.css | sed -n '490,520p'

Repository: opentiny/docs

Length of output: 927


🏁 Script executed:

# Search for any CSS rules that affect .custom-block-content margins or list margins
rg "\.custom-block.*\{|margin.*:" .vitepress/theme/style.css -A 2 -B 1 | head -100

Repository: opentiny/docs

Length of output: 1670


🏁 Script executed:

# Check for any resets or specific rules for lists inside custom-block-content
rg "custom-block-content.*ol|custom-block-content.*ul|custom-block.*ol.*margin|custom-block.*ul.*margin" .vitepress/theme/style.css -A 2

Repository: opentiny/docs

Length of output: 39


Fix double indentation for lists inside custom blocks.

Lines 500–508 apply conflicting margin-left rules: the ol selector adds 32px indentation and .custom-block-content adds another 32px, resulting in 64px total indentation when lists are nested inside the content wrapper (which VitePress renders by default).

Remove the explicit list indentation rule and apply margin only to .custom-block-content, then reset list margins to prevent the compound effect:

Suggested fix
-.vp-doc .custom-block.info ol,
-.vp-doc .custom-block.warning ol,
-.vp-doc .custom-block.danger ol,
-.vp-doc .custom-block.tip ol {
-  margin-left: 32px;
-}
 .vp-doc .custom-block .custom-block-content {
-  margin-left: 32px;
+  margin-inline-start: 32px;
+}
+.vp-doc .custom-block .custom-block-content :is(ol, ul) {
+  margin-inline-start: 0;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.vp-doc .custom-block.info ol,
.vp-doc .custom-block.warning ol,
.vp-doc .custom-block.danger ol,
.vp-doc .custom-block.tip ol {
margin-left: 32px;
}
.vp-doc .custom-block .custom-block-content {
margin-left: 32px;
}
.vp-doc .custom-block .custom-block-content {
margin-inline-start: 32px;
}
.vp-doc .custom-block .custom-block-content :is(ol, ul) {
margin-inline-start: 0;
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.vitepress/theme/style.css around lines 500 - 508, The rules for list
indentation double-apply because both the selectors ".vp-doc .custom-block.info
ol, .vp-doc .custom-block.warning ol, .vp-doc .custom-block.danger ol, .vp-doc
.custom-block.tip ol" and ".vp-doc .custom-block .custom-block-content" add
margin-left; remove the explicit ol selector rules and keep the 32px margin only
on ".vp-doc .custom-block .custom-block-content", then add a reset for lists
inside that container (reset ol and ul margin-left to 0 inside ".vp-doc
.custom-block .custom-block-content") so nested lists do not accumulate
indentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant