Skip to content

Commit e3c19f1

Browse files
committed
Converted CSS vars to theme variables
1 parent 523c999 commit e3c19f1

File tree

6 files changed

+96
-99
lines changed

6 files changed

+96
-99
lines changed

packages/create/src/frameworks/react/project/base/src/components/Footer.tsx.ejs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default function Footer() {
22
const year = new Date().getFullYear()
33

44
return (
5-
<footer className="mt-20 border-t border-[var(--line)] px-4 pb-14 pt-10 text-[var(--sea-ink-soft)]">
5+
<footer className="mt-20 border-t border-line px-4 pb-14 pt-10 text-sea-ink-soft">
66
<div className="page-wrap flex flex-col items-center justify-between gap-4 text-center sm:flex-row sm:text-left">
77
<p className="m-0 text-sm">&copy; {year} Your name here. All rights reserved.</p>
88
<p className="island-kicker m-0">Built with TanStack Start</p>
@@ -12,7 +12,7 @@ export default function Footer() {
1212
href="https://x.com/tan_stack"
1313
target="_blank"
1414
rel="noreferrer"
15-
className="rounded-xl p-2 text-[var(--sea-ink-soft)] transition hover:bg-[var(--link-bg-hover)] hover:text-[var(--sea-ink)]"
15+
className="rounded-xl p-2 text-sea-ink-soft transition hover:bg-link-bg-hover hover:text-sea-ink"
1616
>
1717
<span className="sr-only">Follow TanStack on X</span>
1818
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32">
@@ -26,7 +26,7 @@ export default function Footer() {
2626
href="https://github.com/TanStack"
2727
target="_blank"
2828
rel="noreferrer"
29-
className="rounded-xl p-2 text-[var(--sea-ink-soft)] transition hover:bg-[var(--link-bg-hover)] hover:text-[var(--sea-ink)]"
29+
className="rounded-xl p-2 text-sea-ink-soft transition hover:bg-link-bg-hover hover:text-sea-ink"
3030
>
3131
<span className="sr-only">Go to TanStack GitHub</span>
3232
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32">

packages/create/src/frameworks/react/project/base/src/components/Header.tsx.ejs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ const userHeaders = integrations.filter((i) => i.type === 'header-user');
1919
2020
export default function Header() {
2121
return (
22-
<header className="sticky top-0 z-50 border-b border-[var(--line)] bg-[var(--header-bg)] px-4 backdrop-blur-lg">
22+
<header className="sticky top-0 z-50 border-b border-line bg-header-bg px-4 backdrop-blur-lg">
2323
<nav className="page-wrap flex flex-wrap items-center gap-x-3 gap-y-2 py-3 sm:py-4">
2424
<h2 className="m-0 flex-shrink-0 text-base font-semibold tracking-tight">
2525
<Link
2626
to="/"
27-
className="inline-flex items-center gap-2 rounded-full border border-[var(--chip-line)] bg-[var(--chip-bg)] px-3 py-1.5 text-sm text-[var(--sea-ink)] no-underline shadow-[0_8px_24px_rgba(30,90,72,0.08)] sm:px-4 sm:py-2"
27+
className="inline-flex items-center gap-2 rounded-full border border-chip-line bg-chip-bg px-3 py-1.5 text-sm text-sea-ink no-underline shadow-[0_8px_24px_rgba(30,90,72,0.08)] sm:px-4 sm:py-2"
2828
>
2929
<span className="h-2 w-2 rounded-full bg-[linear-gradient(90deg,#56c6be,#7ed3bf)]" />
3030
TanStack Start
@@ -36,7 +36,7 @@ export default function Header() {
3636
href="https://x.com/tan_stack"
3737
target="_blank"
3838
rel="noreferrer"
39-
className="hidden rounded-xl p-2 text-[var(--sea-ink-soft)] transition hover:bg-[var(--link-bg-hover)] hover:text-[var(--sea-ink)] sm:block"
39+
className="hidden rounded-xl p-2 text-sea-ink-soft transition hover:bg-link-bg-hover hover:text-sea-ink sm:block"
4040
>
4141
<span className="sr-only">Follow TanStack on X</span>
4242
<svg viewBox="0 0 16 16" aria-hidden="true" width="24" height="24">
@@ -50,7 +50,7 @@ export default function Header() {
5050
href="https://github.com/TanStack"
5151
target="_blank"
5252
rel="noreferrer"
53-
className="hidden rounded-xl p-2 text-[var(--sea-ink-soft)] transition hover:bg-[var(--link-bg-hover)] hover:text-[var(--sea-ink)] sm:block"
53+
className="hidden rounded-xl p-2 text-sea-ink-soft transition hover:bg-link-bg-hover hover:text-sea-ink sm:block"
5454
>
5555
<span className="sr-only">Go to TanStack GitHub</span>
5656
<svg viewBox="0 0 16 16" aria-hidden="true" width="24" height="24">
@@ -86,10 +86,10 @@ export default function Header() {
8686
</a>
8787
<% if (demoRoutes.length > 0) { %><details className="relative w-full sm:w-auto">
8888
<summary className="nav-link list-none cursor-pointer">Demos</summary>
89-
<div className="mt-2 min-w-56 rounded-xl border border-[var(--line)] bg-[var(--header-bg)] p-2 shadow-lg sm:absolute sm:right-0">
89+
<div className="mt-2 min-w-56 rounded-xl border border-line bg-header-bg p-2 shadow-lg sm:absolute sm:right-0">
9090
<% for (const route of demoRoutes) { %><a
9191
href="<%= route.url %>"
92-
className="block rounded-lg px-3 py-2 text-sm text-[var(--sea-ink-soft)] no-underline transition hover:bg-[var(--link-bg-hover)] hover:text-[var(--sea-ink)]"
92+
className="block rounded-lg px-3 py-2 text-sm text-sea-ink-soft no-underline transition hover:bg-link-bg-hover hover:text-sea-ink"
9393
>
9494
<%= route.name %>
9595
</a>

packages/create/src/frameworks/react/project/base/src/components/ThemeToggle.tsx.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export default function ThemeToggle() {
7373
onClick={toggleMode}
7474
aria-label={label}
7575
title={label}
76-
className="rounded-full border border-[var(--chip-line)] bg-[var(--chip-bg)] px-3 py-1.5 text-sm font-semibold text-[var(--sea-ink)] shadow-[0_8px_22px_rgba(30,90,72,0.08)] transition hover:-translate-y-0.5"
76+
className="rounded-full border border-chip-line bg-chip-bg px-3 py-1.5 text-sm font-semibold text-sea-ink shadow-[0_8px_22px_rgba(30,90,72,0.08)] transition hover:-translate-y-0.5"
7777
>
7878
{mode === 'auto' ? 'Auto' : mode === 'dark' ? 'Dark' : 'Light'}
7979
</button>

packages/create/src/frameworks/react/project/base/src/routes/about.tsx.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ function About() {
99
<main className="page-wrap px-4 py-12">
1010
<section className="island-shell rounded-2xl p-6 sm:p-8">
1111
<p className="island-kicker mb-2">About</p>
12-
<h1 className="display-title mb-3 text-4xl font-bold text-[var(--sea-ink)] sm:text-5xl">
12+
<h1 className="display-title mb-3 text-4xl font-bold text-sea-ink sm:text-5xl">
1313
A small starter with room to grow.
1414
</h1>
15-
<p className="m-0 max-w-3xl text-base leading-8 text-[var(--sea-ink-soft)]">
15+
<p className="m-0 max-w-3xl text-base leading-8 text-sea-ink-soft">
1616
TanStack Start gives you type-safe routing, server functions, and modern SSR defaults.
1717
Use this as a clean foundation, then layer in your own routes, styling, and add-ons.
1818
</p>

packages/create/src/frameworks/react/project/base/src/routes/index.tsx.ejs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ function App() {
99
<div className="pointer-events-none absolute -left-20 -top-24 h-56 w-56 rounded-full bg-[radial-gradient(circle,rgba(79,184,178,0.32),transparent_66%)]" />
1010
<div className="pointer-events-none absolute -bottom-20 -right-20 h-56 w-56 rounded-full bg-[radial-gradient(circle,rgba(47,106,74,0.18),transparent_66%)]" />
1111
<p className="island-kicker mb-3">TanStack Start Base Template</p>
12-
<h1 className="display-title mb-5 max-w-3xl text-4xl leading-[1.02] font-bold tracking-tight text-[var(--sea-ink)] sm:text-6xl">
12+
<h1 className="display-title mb-5 max-w-3xl text-4xl leading-[1.02] font-bold tracking-tight text-sea-ink sm:text-6xl">
1313
Start simple, ship quickly.
1414
</h1>
15-
<p className="mb-8 max-w-2xl text-base text-[var(--sea-ink-soft)] sm:text-lg">
15+
<p className="mb-8 max-w-2xl text-base text-sea-ink-soft sm:text-lg">
1616
This base starter intentionally keeps things light: two routes, clean structure,
1717
and the essentials you need to build from scratch.
1818
</p>
1919
<div className="flex flex-wrap gap-3">
2020
<a
2121
href="/about"
22-
className="rounded-full border border-[rgba(50,143,151,0.3)] bg-[rgba(79,184,178,0.14)] px-5 py-2.5 text-sm font-semibold text-[var(--lagoon-deep)] no-underline transition hover:-translate-y-0.5 hover:bg-[rgba(79,184,178,0.24)]"
22+
className="rounded-full border border-[rgba(50,143,151,0.3)] bg-[rgba(79,184,178,0.14)] px-5 py-2.5 text-sm font-semibold text-lagoon-deep no-underline transition hover:-translate-y-0.5 hover:bg-[rgba(79,184,178,0.24)]"
2323
>
2424
About This Starter
2525
</a>
2626
<a
2727
href="https://tanstack.com/router"
2828
target="_blank"
2929
rel="noopener noreferrer"
30-
className="rounded-full border border-[rgba(23,58,64,0.2)] bg-white/50 px-5 py-2.5 text-sm font-semibold text-[var(--sea-ink)] no-underline transition hover:-translate-y-0.5 hover:border-[rgba(23,58,64,0.35)]"
30+
className="rounded-full border border-[rgba(23,58,64,0.2)] bg-white/50 px-5 py-2.5 text-sm font-semibold text-sea-ink no-underline transition hover:-translate-y-0.5 hover:border-[rgba(23,58,64,0.35)]"
3131
>
3232
Router Guide
3333
</a>
@@ -46,15 +46,15 @@ function App() {
4646
className="island-shell feature-card rise-in rounded-2xl p-5"
4747
style={{ animationDelay: `${index * 90 + 80}ms` }}
4848
>
49-
<h2 className="mb-2 text-base font-semibold text-[var(--sea-ink)]">{title}</h2>
50-
<p className="m-0 text-sm text-[var(--sea-ink-soft)]">{desc}</p>
49+
<h2 className="mb-2 text-base font-semibold text-sea-ink">{title}</h2>
50+
<p className="m-0 text-sm text-sea-ink-soft">{desc}</p>
5151
</article>
5252
))}
5353
</section>
5454

5555
<section className="island-shell mt-8 rounded-2xl p-6">
5656
<p className="island-kicker mb-2">Quick Start</p>
57-
<ul className="m-0 list-disc space-y-2 pl-5 text-sm text-[var(--sea-ink-soft)]">
57+
<ul className="m-0 list-disc space-y-2 pl-5 text-sm text-sea-ink-soft">
5858
<li>
5959
Edit <code>src/routes/index.tsx</code> to customize the home page.
6060
</li>

packages/create/src/frameworks/react/project/base/src/styles.css.ejs

Lines changed: 77 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -4,73 +4,70 @@
44

55
@theme {
66
--font-sans: "Manrope", ui-sans-serif, system-ui, sans-serif;
7-
}
8-
9-
:root {
10-
--sea-ink: #173a40;
11-
--sea-ink-soft: #416166;
12-
--lagoon: #4fb8b2;
13-
--lagoon-deep: #328f97;
14-
--palm: #2f6a4a;
15-
--sand: #e7f0e8;
16-
--foam: #f3faf5;
17-
--surface: rgba(255, 255, 255, 0.74);
18-
--surface-strong: rgba(255, 255, 255, 0.9);
19-
--line: rgba(23, 58, 64, 0.14);
20-
--inset-glint: rgba(255, 255, 255, 0.82);
21-
--kicker: rgba(47, 106, 74, 0.9);
22-
--bg-base: #e7f3ec;
23-
--header-bg: rgba(251, 255, 248, 0.84);
24-
--chip-bg: rgba(255, 255, 255, 0.8);
25-
--chip-line: rgba(47, 106, 74, 0.18);
26-
--link-bg-hover: rgba(255, 255, 255, 0.9);
27-
--hero-a: rgba(79, 184, 178, 0.36);
28-
--hero-b: rgba(47, 106, 74, 0.2);
7+
--color-sea-ink: #173a40;
8+
--color-sea-ink-soft: #416166;
9+
--color-lagoon: #4fb8b2;
10+
--color-lagoon-deep: #328f97;
11+
--color-palm: #2f6a4a;
12+
--color-sand: #e7f0e8;
13+
--color-foam: #f3faf5;
14+
--color-surface: rgba(255, 255, 255, 0.74);
15+
--color-surface-strong: rgba(255, 255, 255, 0.9);
16+
--color-line: rgba(23, 58, 64, 0.14);
17+
--color-inset-glint: rgba(255, 255, 255, 0.82);
18+
--color-kicker: rgba(47, 106, 74, 0.9);
19+
--color-bg-base: #e7f3ec;
20+
--color-header-bg: rgba(251, 255, 248, 0.84);
21+
--color-chip-bg: rgba(255, 255, 255, 0.8);
22+
--color-chip-line: rgba(47, 106, 74, 0.18);
23+
--color-link-bg-hover: rgba(255, 255, 255, 0.9);
24+
--color-hero-a: rgba(79, 184, 178, 0.36);
25+
--color-hero-b: rgba(47, 106, 74, 0.2);
2926
}
3027

3128
:root[data-theme="dark"] {
32-
--sea-ink: #d7ece8;
33-
--sea-ink-soft: #afcdc8;
34-
--lagoon: #60d7cf;
35-
--lagoon-deep: #8de5db;
36-
--palm: #6ec89a;
37-
--sand: #0f1a1e;
38-
--foam: #101d22;
39-
--surface: rgba(16, 30, 34, 0.8);
40-
--surface-strong: rgba(15, 27, 31, 0.92);
41-
--line: rgba(141, 229, 219, 0.18);
42-
--inset-glint: rgba(194, 247, 238, 0.14);
43-
--kicker: #b8efe5;
44-
--bg-base: #0a1418;
45-
--header-bg: rgba(10, 20, 24, 0.8);
46-
--chip-bg: rgba(13, 28, 32, 0.9);
47-
--chip-line: rgba(141, 229, 219, 0.24);
48-
--link-bg-hover: rgba(24, 44, 49, 0.8);
49-
--hero-a: rgba(96, 215, 207, 0.18);
50-
--hero-b: rgba(110, 200, 154, 0.12);
29+
--color-sea-ink: #d7ece8;
30+
--color-sea-ink-soft: #afcdc8;
31+
--color-lagoon: #60d7cf;
32+
--color-lagoon-deep: #8de5db;
33+
--color-palm: #6ec89a;
34+
--color-sand: #0f1a1e;
35+
--color-foam: #101d22;
36+
--color-surface: rgba(16, 30, 34, 0.8);
37+
--color-surface-strong: rgba(15, 27, 31, 0.92);
38+
--color-line: rgba(141, 229, 219, 0.18);
39+
--color-inset-glint: rgba(194, 247, 238, 0.14);
40+
--color-kicker: #b8efe5;
41+
--color-bg-base: #0a1418;
42+
--color-header-bg: rgba(10, 20, 24, 0.8);
43+
--color-chip-bg: rgba(13, 28, 32, 0.9);
44+
--color-chip-line: rgba(141, 229, 219, 0.24);
45+
--color-link-bg-hover: rgba(24, 44, 49, 0.8);
46+
--color-hero-a: rgba(96, 215, 207, 0.18);
47+
--color-hero-b: rgba(110, 200, 154, 0.12);
5148
}
5249

5350
@media (prefers-color-scheme: dark) {
5451
:root:not([data-theme="light"]) {
55-
--sea-ink: #d7ece8;
56-
--sea-ink-soft: #afcdc8;
57-
--lagoon: #60d7cf;
58-
--lagoon-deep: #8de5db;
59-
--palm: #6ec89a;
60-
--sand: #0f1a1e;
61-
--foam: #101d22;
62-
--surface: rgba(16, 30, 34, 0.8);
63-
--surface-strong: rgba(15, 27, 31, 0.92);
64-
--line: rgba(141, 229, 219, 0.18);
65-
--inset-glint: rgba(194, 247, 238, 0.14);
66-
--kicker: #b8efe5;
67-
--bg-base: #0a1418;
68-
--header-bg: rgba(10, 20, 24, 0.8);
69-
--chip-bg: rgba(13, 28, 32, 0.9);
70-
--chip-line: rgba(141, 229, 219, 0.24);
71-
--link-bg-hover: rgba(24, 44, 49, 0.8);
72-
--hero-a: rgba(96, 215, 207, 0.18);
73-
--hero-b: rgba(110, 200, 154, 0.12);
52+
--color-sea-ink: #d7ece8;
53+
--color-sea-ink-soft: #afcdc8;
54+
--color-lagoon: #60d7cf;
55+
--color-lagoon-deep: #8de5db;
56+
--color-palm: #6ec89a;
57+
--color-sand: #0f1a1e;
58+
--color-foam: #101d22;
59+
--color-surface: rgba(16, 30, 34, 0.8);
60+
--color-surface-strong: rgba(15, 27, 31, 0.92);
61+
--color-line: rgba(141, 229, 219, 0.18);
62+
--color-inset-glint: rgba(194, 247, 238, 0.14);
63+
--color-kicker: #b8efe5;
64+
--color-bg-base: #0a1418;
65+
--color-header-bg: rgba(10, 20, 24, 0.8);
66+
--color-chip-bg: rgba(13, 28, 32, 0.9);
67+
--color-chip-line: rgba(141, 229, 219, 0.24);
68+
--color-link-bg-hover: rgba(24, 44, 49, 0.8);
69+
--color-hero-a: rgba(96, 215, 207, 0.18);
70+
--color-hero-b: rgba(110, 200, 154, 0.12);
7471
}
7572
}
7673

@@ -86,14 +83,14 @@ body,
8683

8784
body {
8885
margin: 0;
89-
color: var(--sea-ink);
86+
color: var(--color-sea-ink);
9087
font-family: var(--font-sans);
91-
background-color: var(--bg-base);
88+
background-color: var(--color-bg-base);
9289
background:
93-
radial-gradient(1100px 620px at -8% -10%, var(--hero-a), transparent 58%),
94-
radial-gradient(1050px 620px at 112% -12%, var(--hero-b), transparent 62%),
90+
radial-gradient(1100px 620px at -8% -10%, var(--color-hero-a), transparent 58%),
91+
radial-gradient(1050px 620px at 112% -12%, var(--color-hero-b), transparent 62%),
9592
radial-gradient(720px 380px at 50% 115%, rgba(79, 184, 178, 0.1), transparent 68%),
96-
linear-gradient(180deg, color-mix(in oklab, var(--sand) 68%, white) 0%, var(--foam) 44%, var(--bg-base) 100%);
93+
linear-gradient(180deg, color-mix(in oklab, var(--color-sand) 68%, white) 0%, var(--color-foam) 44%, var(--color-bg-base) 100%);
9794
overflow-x: hidden;
9895
-webkit-font-smoothing: antialiased;
9996
-moz-osx-font-smoothing: grayscale;
@@ -127,7 +124,7 @@ body::after {
127124
}
128125

129126
a {
130-
color: var(--lagoon-deep);
127+
color: var(--color-lagoon-deep);
131128
text-decoration-color: rgba(50, 143, 151, 0.4);
132129
text-decoration-thickness: 1px;
133130
text-underline-offset: 2px;
@@ -139,8 +136,8 @@ a:hover {
139136

140137
code {
141138
font-size: 0.9em;
142-
border: 1px solid var(--line);
143-
background: color-mix(in oklab, var(--surface-strong) 82%, white 18%);
139+
border: 1px solid var(--color-line);
140+
background: color-mix(in oklab, var(--color-surface-strong) 82%, white 18%);
144141
border-radius: 7px;
145142
padding: 2px 7px;
146143
}
@@ -164,26 +161,26 @@ pre code {
164161
}
165162

166163
.island-shell {
167-
border: 1px solid var(--line);
168-
background: linear-gradient(165deg, var(--surface-strong), var(--surface));
164+
border: 1px solid var(--color-line);
165+
background: linear-gradient(165deg, var(--color-surface-strong), var(--color-surface));
169166
box-shadow:
170-
0 1px 0 var(--inset-glint) inset,
167+
0 1px 0 var(--color-inset-glint) inset,
171168
0 22px 44px rgba(30, 90, 72, 0.1),
172169
0 6px 18px rgba(23, 58, 64, 0.08);
173170
backdrop-filter: blur(4px);
174171
}
175172

176173
.feature-card {
177-
background: linear-gradient(165deg, color-mix(in oklab, var(--surface-strong) 93%, white 7%), var(--surface));
174+
background: linear-gradient(165deg, color-mix(in oklab, var(--color-surface-strong) 93%, white 7%), var(--color-surface));
178175
box-shadow:
179-
0 1px 0 var(--inset-glint) inset,
176+
0 1px 0 var(--color-inset-glint) inset,
180177
0 18px 34px rgba(30, 90, 72, 0.1),
181178
0 4px 14px rgba(23, 58, 64, 0.06);
182179
}
183180

184181
.feature-card:hover {
185182
transform: translateY(-2px);
186-
border-color: color-mix(in oklab, var(--lagoon-deep) 35%, var(--line));
183+
border-color: color-mix(in oklab, var(--color-lagoon-deep) 35%, var(--color-line));
187184
}
188185

189186
button,
@@ -198,15 +195,15 @@ a {
198195
text-transform: uppercase;
199196
font-weight: 700;
200197
font-size: 0.69rem;
201-
color: var(--kicker);
198+
color: var(--color-kicker);
202199
}
203200

204201
.nav-link {
205202
position: relative;
206203
display: inline-flex;
207204
align-items: center;
208205
text-decoration: none;
209-
color: var(--sea-ink-soft);
206+
color: var(--color-sea-ink-soft);
210207
}
211208

212209
.nav-link::after {
@@ -218,13 +215,13 @@ a {
218215
height: 2px;
219216
transform: scaleX(0);
220217
transform-origin: left;
221-
background: linear-gradient(90deg, var(--lagoon), #7ed3bf);
218+
background: linear-gradient(90deg, var(--color-lagoon), #7ed3bf);
222219
transition: transform 170ms ease;
223220
}
224221

225222
.nav-link:hover,
226223
.nav-link.is-active {
227-
color: var(--sea-ink);
224+
color: var(--color-sea-ink);
228225
}
229226

230227
.nav-link:hover::after,
@@ -239,8 +236,8 @@ a {
239236
}
240237

241238
.site-footer {
242-
border-top: 1px solid var(--line);
243-
background: color-mix(in oklab, var(--header-bg) 84%, transparent 16%);
239+
border-top: 1px solid var(--color-line);
240+
background: color-mix(in oklab, var(--color-header-bg) 84%, transparent 16%);
244241
}
245242

246243
.rise-in {

0 commit comments

Comments
 (0)