Skip to content

docs: update and improve documentation UI#328

Open
Sigmabond01 wants to merge 2 commits intododopayments:mainfrom
Sigmabond01:improve-docs
Open

docs: update and improve documentation UI#328
Sigmabond01 wants to merge 2 commits intododopayments:mainfrom
Sigmabond01:improve-docs

Conversation

@Sigmabond01
Copy link
Copy Markdown

@Sigmabond01 Sigmabond01 commented Nov 22, 2025

Summary

Improved the documentation theme to be more vibrant and modern, replacing the basic default look with a custom violet and slate color palette and adding visual enhancements.

Closes #327

Changes

  • Global Styles (src/app/global.css):
    • Updated color palette to a vibrant violet/slate theme (oklch).
    • Added a mesh gradient background for both light and dark modes.
    • Refined dark mode colors for better contrast.
  • Docs Layout (src/app/docs/layout.tsx):
    • Enabled the theme switcher to allow users to toggle between light and dark modes.

Screenshots/Recordings

Before:
Screenshot 2025-11-22 205806

Screenshot 2025-11-22 205817

After:
Screenshot 2025-11-22 205845

Screenshot 2025-11-22 205856

How to Test

Steps to validate locally:

  1. npm ci
  2. npm run typecheck
  3. npm run build
  4. Run npm run dev and navigate to /docs to see the new theme.

Checklist

  • Title is clear and descriptive
  • Related issue linked (if any)
  • Tests or manual verification steps included
  • CI passes (typecheck & build)
  • Docs updated (if needed)

Summary by CodeRabbit

  • New Features

    • Theme switching is now enabled in the documentation section
  • Style

    • Refreshed color tokens for light and dark modes across the interface
    • Enhanced background visuals with explicit radial gradients
    • Standardized animations and minor scrollbar/utility tweaks for consistent behavior

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link
Copy Markdown

vercel bot commented Nov 22, 2025

@Sigmabond01 is attempting to deploy a commit to the BillingSDK Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 22, 2025

Walkthrough

Docs theme updated: theme switch enabled in the docs layout and global CSS extensively revised (color tokens, gradients, animations, and minor layout/scrollbar adjustments).

Changes

Cohort / File(s) Change Summary
Layout Configuration
src/app/docs/layout.tsx
Enabled theme switch by changing disableThemeSwitch from true to false.
Global Theme & Styling
src/app/global.css
Reworked light/dark theme tokens (new oklch values for background, primary, secondary, foreground, card, popover, accent, destructive, border, input, ring, chart-1..5, sidebar). Added explicit multi-layer radial gradients for light and dark body backgrounds (fixed attachment). Normalized animation keyframes (click-space, click-shift, click-tab, cursor-move) and made minor scrollbar/utility formatting and layout tweaks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10–15 minutes

  • Review focus:
    • src/app/global.css — validate oklch token values, gradient definitions, and keyframe edits.
    • src/app/docs/layout.tsx — confirm theme switch wiring behaves as expected in UI.

Poem

🐰
I hopped through tokens, oklch bright,
I nudged a switch to bring back light,
Gradients curled like morning dew,
Animations winked — a freshened view,
Docs now shimmer, soft and new.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main changes: updating and improving the documentation UI with a new theme.
Description check ✅ Passed The PR description follows the template structure with complete sections including Summary, Changes, Screenshots, How to Test, and Checklist.
Linked Issues check ✅ Passed The PR successfully addresses issue #327 by enhancing the documentation theme with a vibrant violet/slate color palette, mesh gradients, and enabled theme switching.
Out of Scope Changes check ✅ Passed All changes are directly related to improving the documentation UI theme as required by issue #327; no out-of-scope modifications detected.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f1f39d7 and 90ca73d.

📒 Files selected for processing (1)
  • src/app/global.css (5 hunks)
🔇 Additional comments (3)
src/app/global.css (3)

49-121: Verify WCAG contrast ratios for foreground/background text pairs.

The oklch-based color palette appears cohesive and intentional, but WCAG accessibility requirements should be verified, especially for:

  • Light mode: oklch(0.15 0.05 260) foreground on oklch(0.985 0.01 260) background
  • Dark mode: oklch(0.98 0.01 260) foreground on oklch(0.12 0.05 260) background
  • Secondary/muted text colors against their respective backgrounds

Run a contrast check on rendered text using a tool like WebAIM or axe DevTools to ensure AA (4.5:1 for normal text) or AAA (7:1) compliance.


132-146: Verify gradient visual appearance matches design intent.

The mesh gradient implementation using background-attachment: fixed is well-structured and should create the intended visual effect. Light mode uses subtle 90–95% lightness overlays, while dark mode uses darker 7–30% lightness values.

After running npm run dev, visually inspect /docs in both light and dark modes to confirm the gradient appearance matches the design screenshots and that text remains readable over the gradient.


223-349: Verify keyframe animations render identically after formatting changes.

The keyframe consolidation (e.g., 0%, 100% combined) and percent notation normalization are formatting improvements. However, ensure the animations still function correctly.

After running npm run dev, interact with components that trigger the click-space, click-shift, click-tab, and cursor-move animations to verify they render smoothly and without visual regressions.


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.

@Sigmabond01
Copy link
Copy Markdown
Author

@aagarwal1012 Please took a look, thank you!

Copy link
Copy Markdown
Contributor

@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: 0

🧹 Nitpick comments (1)
src/app/global.css (1)

128-147: Consider removing duplicate gradient definition.

The base body gradient (lines 130-133) is identical to the .dark body gradient (lines 137-139). Since both light and dark mode variants override the base gradient, the duplication serves no functional purpose.

Consider this refactor to eliminate the duplication:

   body {
     @apply bg-background text-foreground;
-    background-image: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
-      radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
-      radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
-    background-attachment: fixed;
   }
 
   .dark body {
+    background-image: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
+      radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
+      radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
+    background-attachment: fixed;
-    background-image: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
-      radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
-      radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
   }
 
   /* Light mode gradient */
   :root:not(.dark) body {
     background-image: radial-gradient(at 0% 0%, hsla(253, 16%, 90%, 1) 0, transparent 50%),
       radial-gradient(at 50% 0%, hsla(225, 39%, 95%, 1) 0, transparent 50%),
       radial-gradient(at 100% 0%, hsla(339, 49%, 95%, 1) 0, transparent 50%);
+    background-attachment: fixed;
   }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd36606 and f1f39d7.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • src/app/docs/layout.tsx (1 hunks)
  • src/app/global.css (5 hunks)
🔇 Additional comments (2)
src/app/docs/layout.tsx (1)

28-28: LGTM! Theme switcher enabled successfully.

This change enables the theme toggle UI, allowing users to switch between the new light and dark color schemes defined in global.css. The change aligns perfectly with the PR objectives.

src/app/global.css (1)

50-84: <!-- [scratchpad_start]
[task verify_oklch_browser_support 1/1]
Verify oklch() CSS color function browser support claims

[observations]

  • Original review stated: "limited support in older browsers (requires Chrome 111+, Firefox 113+, Safari 15.4+)"
  • Web search result (Nov 22, 2025): ~92% global support, supported in all major browsers since specified versions
  • All major browsers now support oklch(): Chrome 111+, Firefox 113+, Safari 15.4+, Edge 111+, Opera, most Android browsers
  • Recommendation in results: provide fallbacks or feature-detect with @supports for remaining unsupported cases

[analysis]

  • Original review's version requirements are accurate
  • Characterization of "limited support" is somewhat understated given 92% global support
  • Recommendation for fallbacks/feature-detection is still valid and best practice
  • No critical issues identified with the color choices themselves
  • The review comment is substantively correct but could be more balanced

[pending]
None - sufficient information gathered

[actions]
Rewrite review comment with:

  1. Acknowledge good browser support (92% global)
  2. Keep fallback recommendation (still valid for remaining 8%)
  3. Tone down "limited support" characterization
  4. Preserve actionable guidance

[done]
Browser compatibility verification complete. Review comment recommendations are valid.
[scratchpad_end]


Verify oklch color space browser compatibility and consider fallbacks for older browsers.

The migration to oklch colors provides excellent perceptual uniformity and is ideal for programmatic theming. oklch() has broad, modern-browser support — supported in Chrome (since 111), Edge (since 111), Firefox (since 113), and Safari (since 15.4), plus current desktop/mobile builds of Opera and most Android browsers, with ~92% global support. For the remaining older or niche browsers without support, provide fallbacks or feature-detect with @supports.

Also applies to: 86-121

@sandipkumardey
Copy link
Copy Markdown
Contributor

sandipkumardey commented Dec 23, 2025

Hi @Sigmabond01, I don't think it's needed anymore, as we already have an updated doc UI. Thanks.

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.

Improve Docs Theme

2 participants