Skip to content

feat: add dark mode theme system with smooth transition#4

Merged
mintritech merged 1 commit into
devfrom
feat/ui-components
Mar 14, 2026
Merged

feat: add dark mode theme system with smooth transition#4
mintritech merged 1 commit into
devfrom
feat/ui-components

Conversation

@mintritech

@mintritech mintritech commented Mar 14, 2026

Copy link
Copy Markdown
Member

📝 Description

🔗 Related Issue

Closes #

🎯 Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🔨 Refactoring
  • 📦 library update
  • 📝 Documentation
  • 🎨 UI/UX

✅ Checklist

  • Code đã được test locally
  • Không có lỗi lint
  • Đã cập nhật documentation (nếu cần)

📸 Screenshots (nếu có)

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review Summary

This PR adds dark mode functionality but contains 8 critical issues that block merge:

Critical Issues:

  1. Logic Error (provider/index.tsx): The disableTransitionOnChange prop contradicts the PR's goal of smooth transitions
  2. Syntax Errors (page.tsx - 7 instances): Invalid Tailwind CSS class names using bg-linear-to-* instead of bg-gradient-to-* will cause styling failures

All gradient backgrounds and the smooth transition feature will fail to render correctly. Please apply the suggested fixes before merging.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Comment thread src/provider/index.tsx
Comment on lines +15 to +20
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Logic Error: Remove disableTransitionOnChange to enable smooth theme transitions. This prop prevents CSS transitions during theme changes, contradicting the PR's stated goal of adding "smooth transition" functionality.

Suggested change
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
>

Comment thread src/app/page.tsx
export default function HomePage(): React.ReactElement {
return (
<div className="min-h-screen bg-linear-to-b from-slate-50 to-white">
<div className="min-h-screen bg-linear-to-b from-slate-50 to-white dark:from-gray-950 dark:to-gray-900">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Syntax Error: Replace bg-linear-to-b with bg-gradient-to-b. The current class name is invalid Tailwind CSS syntax and will not render any background gradient.

Suggested change
<div className="min-h-screen bg-linear-to-b from-slate-50 to-white dark:from-gray-950 dark:to-gray-900">
<div className="min-h-screen bg-gradient-to-b from-slate-50 to-white dark:from-gray-950 dark:to-gray-900">

Comment thread src/app/page.tsx
<div className="mx-auto max-w-7xl px-6 py-4">
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
<div className="flex h-9 w-9 items-center justify-center rounded-lg bg-linear-to-br from-blue-600 to-indigo-600">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Syntax Error: Replace bg-linear-to-br with bg-gradient-to-br. Invalid Tailwind CSS class name will not apply any gradient styling.

Suggested change
<div className="flex h-9 w-9 items-center justify-center rounded-lg bg-linear-to-br from-blue-600 to-indigo-600">
<div className="flex h-9 w-9 items-center justify-center rounded-lg bg-gradient-to-br from-blue-600 to-indigo-600">

Comment thread src/app/page.tsx
<h1 className="mb-6 text-5xl font-bold leading-tight text-slate-900 dark:text-white md:text-6xl">
Xây dựng sản phẩm
<br />
<span className="bg-linear-to-r from-blue-600 to-indigo-600 bg-clip-text text-transparent">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Syntax Error: Replace bg-linear-to-r with bg-gradient-to-r. Invalid Tailwind CSS class name will not render the text gradient effect.

Suggested change
<span className="bg-linear-to-r from-blue-600 to-indigo-600 bg-clip-text text-transparent">
<span className="bg-gradient-to-r from-blue-600 to-indigo-600 bg-clip-text text-transparent">

Comment thread src/app/page.tsx
<div className="relative">
<div className="absolute -inset-4 rounded-3xl bg-linear-to-r from-blue-100 to-indigo-100 opacity-50 blur-2xl" />
<div className="relative overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-xl">
<div className="absolute -inset-4 rounded-3xl bg-linear-to-r from-blue-100 to-indigo-100 opacity-50 blur-2xl dark:from-blue-900 dark:to-indigo-900" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Syntax Error: Replace bg-linear-to-r with bg-gradient-to-r. Invalid Tailwind CSS class name prevents the blur effect's gradient background from rendering.

Suggested change
<div className="absolute -inset-4 rounded-3xl bg-linear-to-r from-blue-100 to-indigo-100 opacity-50 blur-2xl dark:from-blue-900 dark:to-indigo-900" />
<div className="absolute -inset-4 rounded-3xl bg-gradient-to-r from-blue-100 to-indigo-100 opacity-50 blur-2xl dark:from-blue-900 dark:to-indigo-900" />

Comment thread src/app/page.tsx
<div
key={i}
className="group rounded-2xl border border-slate-200 bg-linear-to-br from-slate-50 to-white p-8 transition-all hover:border-slate-300 hover:shadow-lg"
className="group rounded-2xl border border-slate-200 bg-linear-to-br from-slate-50 to-white p-8 transition-all hover:border-slate-300 hover:shadow-lg dark:border-gray-700 dark:from-gray-800 dark:to-gray-900 dark:hover:border-gray-600"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Syntax Error: Replace bg-linear-to-br with bg-gradient-to-br. Invalid Tailwind CSS class name will not render gradient backgrounds on feature cards.

Suggested change
className="group rounded-2xl border border-slate-200 bg-linear-to-br from-slate-50 to-white p-8 transition-all hover:border-slate-300 hover:shadow-lg dark:border-gray-700 dark:from-gray-800 dark:to-gray-900 dark:hover:border-gray-600"
className="group rounded-2xl border border-slate-200 bg-gradient-to-br from-slate-50 to-white p-8 transition-all hover:border-slate-300 hover:shadow-lg dark:border-gray-700 dark:from-gray-800 dark:to-gray-900 dark:hover:border-gray-600"

Comment thread src/app/page.tsx
className="group rounded-2xl border border-slate-200 bg-linear-to-br from-slate-50 to-white p-8 transition-all hover:border-slate-300 hover:shadow-lg dark:border-gray-700 dark:from-gray-800 dark:to-gray-900 dark:hover:border-gray-600"
>
<div
className={`mb-4 flex h-14 w-14 items-center justify-center rounded-xl bg-linear-to-br ${feature.color} text-3xl shadow-lg`}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Syntax Error: Replace bg-linear-to-br with bg-gradient-to-br. Invalid Tailwind CSS class name in template literal prevents icon gradient backgrounds from rendering.

Suggested change
className={`mb-4 flex h-14 w-14 items-center justify-center rounded-xl bg-linear-to-br ${feature.color} text-3xl shadow-lg`}
className={`mb-4 flex h-14 w-14 items-center justify-center rounded-xl bg-gradient-to-br ${feature.color} text-3xl shadow-lg`}

Comment thread src/app/page.tsx

{/* CTA */}
<section className="border-y border-slate-200 bg-linear-to-br from-blue-600 to-indigo-600 py-20 md:py-24">
<section className="border-y border-slate-200 bg-linear-to-br from-blue-600 to-indigo-600 py-20 md:py-24 dark:border-gray-800">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Syntax Error: Replace bg-linear-to-br with bg-gradient-to-br. Invalid Tailwind CSS class names will not apply gradient backgrounds to the CTA section and footer logo.

Suggested change
<section className="border-y border-slate-200 bg-linear-to-br from-blue-600 to-indigo-600 py-20 md:py-24 dark:border-gray-800">
<section className="border-y border-slate-200 bg-gradient-to-br from-blue-600 to-indigo-600 py-20 md:py-24 dark:border-gray-800">

@mintritech mintritech merged commit 027c21a into dev Mar 14, 2026
4 checks passed
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.

2 participants