Skip to content

Commit 0463f45

Browse files
samcxhuozhi
authored andcommitted
chore(cna): fix theme extend for tailwind v4 (#76583)
## Why? We are not extending the tailwind theme for `--color-background` and `--color-foreground`. (Before) https://github.com/user-attachments/assets/d336dab3-a00f-46cb-9587-055a6c5272fa (After) https://github.com/user-attachments/assets/123e829d-aa7e-4b57-aa21-261fc05350f8 Follow-up fix for #75407.
1 parent 86c8c4c commit 0463f45

File tree

4 files changed

+32
-24
lines changed

4 files changed

+32
-24
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
@import "tailwindcss";
22

3-
@theme {
4-
--font-sans: var(--font-geist-sans);
5-
--font-mono: var(--font-geist-mono);
6-
}
7-
83
:root {
94
--background: #ffffff;
105
--foreground: #171717;
116
}
127

8+
@theme inline {
9+
--color-background: var(--background);
10+
--color-foreground: var(--foreground);
11+
--font-sans: var(--font-geist-sans);
12+
--font-mono: var(--font-geist-mono);
13+
}
14+
1315
@media (prefers-color-scheme: dark) {
1416
:root {
1517
--background: #0a0a0a;
@@ -18,7 +20,7 @@
1820
}
1921

2022
body {
21-
color: var(--foreground);
2223
background: var(--background);
24+
color: var(--foreground);
2325
font-family: Arial, Helvetica, sans-serif;
2426
}
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
@import "tailwindcss";
22

3-
@theme {
4-
--font-sans: var(--font-geist-sans);
5-
--font-mono: var(--font-geist-mono);
6-
}
7-
83
:root {
94
--background: #ffffff;
105
--foreground: #171717;
116
}
127

8+
@theme inline {
9+
--color-background: var(--background);
10+
--color-foreground: var(--foreground);
11+
--font-sans: var(--font-geist-sans);
12+
--font-mono: var(--font-geist-mono);
13+
}
14+
1315
@media (prefers-color-scheme: dark) {
1416
:root {
1517
--background: #0a0a0a;
@@ -18,7 +20,7 @@
1820
}
1921

2022
body {
21-
color: var(--foreground);
2223
background: var(--background);
24+
color: var(--foreground);
2325
font-family: Arial, Helvetica, sans-serif;
2426
}
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
@import "tailwindcss";
22

3-
@theme {
4-
--font-sans: var(--font-geist-sans);
5-
--font-mono: var(--font-geist-mono);
6-
}
7-
83
:root {
94
--background: #ffffff;
105
--foreground: #171717;
116
}
127

8+
@theme inline {
9+
--color-background: var(--background);
10+
--color-foreground: var(--foreground);
11+
--font-sans: var(--font-geist-sans);
12+
--font-mono: var(--font-geist-mono);
13+
}
14+
1315
@media (prefers-color-scheme: dark) {
1416
:root {
1517
--background: #0a0a0a;
@@ -18,7 +20,7 @@
1820
}
1921

2022
body {
21-
color: var(--foreground);
2223
background: var(--background);
24+
color: var(--foreground);
2325
font-family: Arial, Helvetica, sans-serif;
2426
}
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
@import "tailwindcss";
22

3-
@theme {
4-
--font-sans: var(--font-geist-sans);
5-
--font-mono: var(--font-geist-mono);
6-
}
7-
83
:root {
94
--background: #ffffff;
105
--foreground: #171717;
116
}
127

8+
@theme inline {
9+
--color-background: var(--background);
10+
--color-foreground: var(--foreground);
11+
--font-sans: var(--font-geist-sans);
12+
--font-mono: var(--font-geist-mono);
13+
}
14+
1315
@media (prefers-color-scheme: dark) {
1416
:root {
1517
--background: #0a0a0a;
@@ -18,7 +20,7 @@
1820
}
1921

2022
body {
21-
color: var(--foreground);
2223
background: var(--background);
24+
color: var(--foreground);
2325
font-family: Arial, Helvetica, sans-serif;
2426
}

0 commit comments

Comments
 (0)