From 49da4b598a4bbff3af90235d5dcc3783cc861d49 Mon Sep 17 00:00:00 2001
From: Cursor Agent
Date: Sun, 12 Oct 2025 10:03:58 +0000
Subject: [PATCH] Refactor: Use CSS variables for theming and colors
Co-authored-by: nicomarchand29
---
app/blog/[id]/page.tsx | 2 +-
app/blog/page.tsx | 2 +-
app/client-page/page.tsx | 2 +-
app/components/Button.tsx | 20 ++++-----
app/components/DonutChart.tsx | 12 +++---
app/components/blog/AiMarketShareChart.tsx | 4 +-
app/components/mdx.tsx | 12 +++---
app/components/ui/Footer.tsx | 2 +-
app/components/ui/HeroImage.tsx | 4 +-
app/components/ui/HowItWorks.tsx | 6 +--
app/components/ui/Navbar.tsx | 4 +-
app/globals.css | 48 ++++++++++++++++------
app/layout.tsx | 27 ++++++++++--
app/page.tsx | 2 +-
app/privacy/page.tsx | 28 ++++++-------
app/terms/page.tsx | 22 +++++-----
tailwind.config.ts | 39 ++++++++++++------
17 files changed, 147 insertions(+), 89 deletions(-)
diff --git a/app/blog/[id]/page.tsx b/app/blog/[id]/page.tsx
index ff4289c..75d50b5 100644
--- a/app/blog/[id]/page.tsx
+++ b/app/blog/[id]/page.tsx
@@ -112,7 +112,7 @@ export default async function ArticlePage({ params }: ArticlePageProps) {
Go to the main page
diff --git a/app/components/Button.tsx b/app/components/Button.tsx
index 55e542d..7994035 100644
--- a/app/components/Button.tsx
+++ b/app/components/Button.tsx
@@ -33,13 +33,13 @@ const buttonVariants = tv({
],
secondary: [
// border
- "border-gray-300 dark:border-gray-800",
+ "border-[rgb(var(--color-border))]",
// text color
- "text-text-secondary-dark dark:text-gray-50",
+ "text-text-secondary-dark dark:text-[rgb(var(--color-foreground))]",
// background color
- "bg-white dark:bg-gray-950",
+ "bg-[rgb(var(--color-surface))]",
//hover color
- "hover:bg-gray-50 dark:hover:bg-gray-900/60",
+ "hover:bg-[rgb(var(--color-surface))]/90",
// disabled
"disabled:text-secondary-light",
"disabled:dark:text-text-secondary",
@@ -50,14 +50,14 @@ const buttonVariants = tv({
// border
"border-transparent",
// text color
- "text-text-secondary-dark dark:text-gray-50",
+ "text-text-secondary-dark dark:text-[rgb(var(--color-foreground))]",
// background color
- "bg-light dark:bg-gray-900",
+ "bg-light dark:bg-[rgb(var(--color-surface))]",
// hover color
- "hover:bg-gray-300/70 dark:hover:bg-gray-800/80",
+ "hover:bg-gray-300/70 dark:hover:bg-[rgb(var(--color-border))]/20",
// disabled
"disabled:text-secondary-light disabled:bg-light",
- "disabled:dark:bg-gray-800 disabled:dark:text-text-secondary",
+ "disabled:dark:bg-[rgb(var(--color-border))]/20 disabled:dark:text-text-secondary",
],
ghost: [
// base
@@ -65,9 +65,9 @@ const buttonVariants = tv({
// border
"border-transparent",
// text color
- "text-text-secondary-dark dark:text-gray-50",
+ "text-text-secondary-dark dark:text-[rgb(var(--color-foreground))]",
// hover color
- "bg-transparent hover:bg-light dark:hover:bg-gray-800/80",
+ "bg-transparent hover:bg-light dark:hover:bg-[rgb(var(--color-border))]/20",
// disabled
"disabled:text-secondary-light",
"disabled:dark:text-text-secondary",
diff --git a/app/components/DonutChart.tsx b/app/components/DonutChart.tsx
index 002d134..25c2628 100644
--- a/app/components/DonutChart.tsx
+++ b/app/components/DonutChart.tsx
@@ -157,9 +157,9 @@ const ChartTooltip = ({
// base
"rounded px-2 py-1 text-xs shadow-md",
// border color
- "border border-gray-200 dark:border-gray-800",
+ "border border-[rgb(var(--color-border))]",
// background color
- "bg-white dark:bg-gray-950",
+ "bg-[rgb(var(--color-surface))]",
)}
>
{payload.map(({ value, category }, index) => (
@@ -167,10 +167,10 @@ const ChartTooltip = ({
key={`id-${index}`}
className="flex items-center justify-between gap-2"
>
-
+
{category}
-
+
{valueFormatter(value)}
@@ -313,7 +313,7 @@ const DonutChart = React.forwardRef(
{isDonut && showLabel && (
(
)}
{
return (
-
+
AI Chatbot Market Share (Usage)
-
+
Market distribution by platform
) => (
{children}
@@ -47,7 +47,7 @@ export const H1 = ({ children }: React.HTMLProps) => (
export const H2 = ({ children }: React.HTMLProps) => (
{children}
@@ -56,7 +56,7 @@ export const H2 = ({ children }: React.HTMLProps) => (
export const H3 = ({ children }: React.HTMLProps) => (
{children}
@@ -117,7 +117,7 @@ export const Ul = (props: React.HTMLAttributes) => (
export const Bold = (props: React.HTMLAttributes) => (
);
@@ -177,7 +177,7 @@ export const BlogEntry = ({
};
return (
-
+
);
diff --git a/app/components/ui/Footer.tsx b/app/components/ui/Footer.tsx
index a2eebc8..f79d484 100644
--- a/app/components/ui/Footer.tsx
+++ b/app/components/ui/Footer.tsx
@@ -13,7 +13,7 @@ export default function Footer() {
return (