-
Notifications
You must be signed in to change notification settings - Fork 330
fix: resolve the issue of token style in the example #3730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughRefactored the anchor component to render TinyAnchor directly and removed its scoped CSS. Updated the docs view to wrap the anchor in a catalog container and added scoped CSS for layout, scroll behavior, and styling. No public APIs or exports changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (3)
examples/sites/src/components/anchor.vue (1)
70-70: Remove empty scoped style blockAn empty scoped block adds noise and a data‑v attribute without benefit. Safe to drop.
-<style scoped lang="less"></style> +/* styles moved to the docs view (common.vue) */examples/sites/src/views/components-doc/common.vue (2)
78-89: Wrap is fine; add nav semantics for accessibilityAnnotate the catalog as navigation to improve landmarks and screen‑reader discovery.
- <div class="cmp-page-anchor catalog"> + <div class="cmp-page-anchor catalog" role="navigation" aria-label="Page catalog">
573-581: Scrollbar colors: prefer tokens/vars and dark‑mode aware valuesHard‑coded #f5f5f5/#c1c1c1 won’t adapt to themes. Use design tokens or CSS vars with fallbacks.
- .catalog::-webkit-scrollbar { - width: 10px; - background-color: #f5f5f5; - } + .catalog::-webkit-scrollbar { + width: 10px; + background-color: var(--docs-scrollbar-track, #f5f5f5); + } - .catalog::-webkit-scrollbar-thumb { - border-radius: 10px; - background-color: #c1c1c1; - } + .catalog::-webkit-scrollbar-thumb { + border-radius: 10px; + background-color: var(--docs-scrollbar-thumb, #c1c1c1); + }Optional (outside this hunk): define themeable defaults near the top of this style block:
.docs-content { --docs-scrollbar-track: var(--docs-color-bg-2); --docs-scrollbar-thumb: var(--docs-color-border); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
examples/sites/src/components/anchor.vue(2 hunks)examples/sites/src/views/components-doc/common.vue(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Parse Affected Components
🔇 Additional comments (2)
examples/sites/src/components/anchor.vue (1)
2-13: Direct TinyAnchor usage looks good; verify prop casing against TinyAnchor APINice simplification. Please double‑check prop names/casing expected by TinyAnchor (e.g., tiny_mode vs tiny-mode, container-id vs containerId) to avoid silent no‑ops across versions. Keeping id="anchor" is important for the height calc in common.vue.
examples/sites/src/views/components-doc/common.vue (1)
531-538: Affix override may negate is-affix logic—confirm intenttop: unset !important effectively disables sticky/affix behavior, even when :is-affix is true. If this is intended (scrollable sidebar only), consider setting :anchor-affix="false" to avoid unnecessary measurements and state churn.
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Documentation
Style
Refactor