Skip to content

Conversation

@hrshdas
Copy link

@hrshdas hrshdas commented Dec 13, 2025

Summary

Fixed an issue where the blog article title became invisible on hover in dark mode.

Root Cause

The hover state applied a text color that blended with the dark background.

Fix

  • Added dark mode–safe hover classes.
  • Ensured the title remains visible (text-white / dark:group-hover:text-white).

Issue Reference

Fixes #29

Summary by CodeRabbit

  • New Features

    • Added comprehensive dark mode styling to blog cards with optimized background and text colors.
  • Style

    • Improved title hover effect with refined visual feedback for better user interaction.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 13, 2025

Walkthrough

This PR addresses dark mode visibility issues in the blog card component by restructuring how the hover gradient effect is applied to the title and adding comprehensive dark mode styling across the card, along with adding the next-themes dependency for theme management.

Changes

Cohort / File(s) Summary
Dark Mode Styling Updates
components/blog-card.tsx
Added dark mode background (dark:bg-zinc-900), dark text colors for title, excerpt (dark:text-gray-300), and author row (dark:text-gray-400). Restructured title markup to move hover gradient behavior from h2 to nested span to ensure proper visibility on hover.
Theme Management Dependency
package.json
Added next-themes ^0.4.6 dependency for theme switching support.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Small, focused change affecting only styling and one dependency addition
  • No logic or control flow modifications
  • Changes are primarily CSS class additions following Tailwind conventions
  • Dependency addition is straightforward with no breaking changes to existing code

Possibly related PRs

  • Card ui changes #9: Also modifies the BlogCard component (components/blog-card.tsx) with layout and flex behavior restructuring, making it a parallel concern in the same component.

Suggested reviewers

  • ceilican

Poem

🐰 A rabbit hops through dark and light,
Fixing titles that vanish from sight,
With Tailwind's spell and themes so true,
Dark mode blooms—now what's old is new! 🌙✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The addition of 'next-themes' dependency appears out of scope for the stated objective of fixing dark mode styling in an existing component without clear integration into the blog-card.tsx changes. Clarify whether next-themes is required for the dark mode fix or if it's a future dependency; remove it if not directly used in the component changes.
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 (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly describes the main issue being fixed: blog article title disappearing on hover in dark mode, which directly matches the changeset's purpose.
Linked Issues check ✅ Passed The changes directly address issue #29 by adding dark mode styling (dark:bg-zinc-900, dark:text-gray-300, dark:text-gray-400) and restructuring title hover behavior to prevent title invisibility in dark mode.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 113d28d and acf92f4.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • components/blog-card.tsx (2 hunks)
  • package.json (1 hunks)
🔇 Additional comments (2)
components/blog-card.tsx (2)

22-22: border-gradient-to-r may be a no-op Tailwind class (unless custom)
If you’re expecting a gradient border here, Tailwind doesn’t provide border-gradient-to-r by default; consider implementing via bg-gradient-* + p-[1px] wrapper / bg-clip-padding pattern (or confirm you have a custom plugin).


47-52: Hover title should now stay readable in dark mode — please add before/after screenshots to close #29
The “gradient on hover” being scoped to the inner <span> plus dark:group-hover:bg-none / dark:group-hover:text-[#91A511] looks like it prevents the title from becoming effectively invisible in dark mode. Please verify and attach screenshots for: light+hover, light+rest, dark+hover, dark+rest (as requested in the linked issue).

Also applies to: 54-57

"lucide-react": "^0.454.0",
"next": "15.2.4",
"next-mdx-remote": "^5.0.0",
"next-themes": "^0.4.6",
Copy link
Contributor

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:

next-themes 0.4.6 React 19 Next.js 15 compatibility

💡 Result:

Short answer: Yes — next-themes@0.4.6 declares React 19 (including the RC) in its peerDependencies and is compatible with Next.js 15, but you may still encounter peer-dependency install conflicts from other packages in your project.

Evidence:

  • next-themes 0.4.6 on npm (release info). [1]
  • A package-lock snapshot showing next-themes@0.4.6 peerDependencies include react/react-dom "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc". [2]
  • Next.js 15 requires/targets React 19 for the App Router (Next.js 15 docs/blog). [3]

Practical notes:

  • If npm fails with ERESOLVE because other deps still require React ^18, either use npm install --legacy-peer-deps (or --force), add package overrides to align react/react-dom versions, or keep React 18 / Pages Router until all third‑party deps are updated. See Next.js upgrade docs for guidance. [3]

Sources:
[1] npm package page — next-themes 0.4.6.
[2] package-lock snapshot showing next-themes@0.4.6 peerDependencies.
[3] Next.js 15 docs/blog (React 19 guidance).


🏁 Script executed:

# Search for ThemeProvider usage in the codebase
rg "ThemeProvider" --type ts --type tsx --type js --type jsx -A 3

Repository: StabilityNexus/StableViewpoints

Length of output: 102


🏁 Script executed:

# Search for next-themes imports
rg "from.*next-themes|import.*next-themes" --type ts --type tsx --type js --type jsx

Repository: StabilityNexus/StableViewpoints

Length of output: 102


🏁 Script executed:

# Find app root/layout files where provider might be configured
fd -e tsx -e ts -e jsx -e js | grep -E "(layout|root|app)" | head -20

Repository: StabilityNexus/StableViewpoints

Length of output: 192


🏁 Script executed:

cat -n app/layout.tsx | head -100

Repository: StabilityNexus/StableViewpoints

Length of output: 3041


🏁 Script executed:

# Search for ThemeProvider using a simpler grep approach
grep -r "ThemeProvider" app/ 2>/dev/null || echo "No ThemeProvider found"

Repository: StabilityNexus/StableViewpoints

Length of output: 97


Wire next-themes into the app—ThemeProvider is not configured

The dependency is compatible with your stack (next-themes@0.4.6 supports React 19 and Next.js 15), but ThemeProvider is missing from app/layout.tsx. Either add the provider wrapping your layout or remove the unused dependency.

🤖 Prompt for AI Agents
In package.json around line 18, next-themes is declared but not wired into the
app: add ThemeProvider from 'next-themes' into app/layout.tsx and wrap your root
layout children with it (or remove the dependency if you don't intend to use
theming). Import ThemeProvider at the top of app/layout.tsx, wrap the returned
JSX so ThemeProvider is the ancestor of your app content, and configure props
you need (e.g., attribute='class', defaultTheme or enableSystem) to ensure CSS
class-based theme switching works.

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.

Dark Mode: Article title becomes invisible on hover inside Article Cards

2 participants