refactor(css): use CSS custom properties for auth page theme

Define --auth-* variables on .auth-page for all colors, shadows, and
backgrounds. Dark mode now only overrides variables on .auth-page —
zero selector duplication, single source of truth for theme values.
This commit is contained in:
Arnaud Dartois committed 2026-07-19 15:51:07 +00:00
1 parent 0030173c38
commit b955a98760
1 file changed
+43 -48
+43 -48
View File
@@ -106,12 +106,30 @@ code {
/* ─── Auth pages (Login / Register) ─────────────────────────────── */
.auth-page {
/* Theme variables — override in dark mode media query */
--auth-bg-start: #0f172a;
--auth-bg-mid: #1e293b;
--auth-bg-end: #0f172a;
--auth-primary: #6366f1;
--auth-primary-rgb: 99, 102, 241;
--auth-primary-hover: #4f46e5;
--auth-accent: #8b5cf6;
--auth-bg-card: rgba(255, 255, 255, 0.98);
--auth-text-heading: #1e293b;
--auth-text-body: #475569;
--auth-text-link: #6366f1;
--auth-text-link-hover: #4f46e5;
--auth-border: #e2e8f0;
--auth-bg-input: #f8fafc;
--auth-shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
--auth-border-card: rgba(255, 255, 255, 0.05);
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
padding: 1.5rem;
background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
background: linear-gradient(135deg, var(--auth-bg-start) 0%, var(--auth-bg-mid) 50%, var(--auth-bg-end) 100%);
position: relative;
overflow: hidden;
}
@@ -125,7 +143,7 @@ code {
width: 500px;
height: 500px;
border-radius: 50%;
background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
background: radial-gradient(circle, rgba(var(--auth-primary-rgb), 0.15) 0%, transparent 70%);
pointer-events: none;
}
@@ -144,12 +162,12 @@ code {
.auth-card {
width: 100%;
max-width: 420px;
background: rgba(255, 255, 255, 0.98);
background: var(--auth-bg-card);
border-radius: 20px;
padding: 2.5rem 2rem;
box-shadow:
0 25px 50px -12px rgba(0, 0, 0, 0.25),
0 0 0 1px rgba(255, 255, 255, 0.05);
var(--auth-shadow-card),
0 0 0 1px var(--auth-border-card);
position: relative;
z-index: 1;
animation: auth-card-enter 0.4s ease-out;
@@ -178,23 +196,23 @@ code {
width: 56px;
height: 56px;
border-radius: 16px;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
background: linear-gradient(135deg, var(--auth-primary), var(--auth-accent));
color: #fff;
margin-bottom: 1rem;
box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
box-shadow: 0 8px 24px rgba(var(--auth-primary-rgb), 0.3);
}
.auth-header h1 {
font-size: 1.5rem;
font-weight: 700;
color: #1e293b;
color: var(--auth-text-heading);
margin: 0 0 0.25rem;
letter-spacing: -0.02em;
}
.auth-header p {
font-size: 0.875rem;
color: #475569;
color: var(--auth-text-body);
margin: 0;
}
@@ -205,7 +223,7 @@ code {
}
.auth-form .mud-input-outlined {
background: #f8fafc;
background: var(--auth-bg-input);
}
.auth-form .auth-submit-btn {
@@ -226,24 +244,24 @@ code {
text-align: center;
margin-top: 1.5rem;
padding-top: 1.25rem;
border-top: 1px solid #e2e8f0;
border-top: 1px solid var(--auth-border);
}
.auth-footer p {
font-size: 0.875rem;
color: #475569;
color: var(--auth-text-body);
margin: 0;
}
.auth-footer a {
color: #6366f1;
color: var(--auth-text-link);
font-weight: 600;
text-decoration: none;
transition: color 0.2s;
}
.auth-footer a:hover {
color: #4f46e5;
color: var(--auth-text-link-hover);
text-decoration: underline;
}
@@ -271,39 +289,16 @@ code {
color: #ffd966;
}
/* Auth pages */
.auth-card {
background: rgba(30, 41, 59, 0.98);
box-shadow:
0 25px 50px -12px rgba(0, 0, 0, 0.5),
0 0 0 1px rgba(255, 255, 255, 0.05);
}
.auth-header h1 {
color: #f1f5f9;
}
.auth-header p {
color: #cbd5e1;
}
.auth-form .mud-input-outlined {
background: #1e293b;
}
.auth-footer {
border-top-color: #334155;
}
.auth-footer p {
color: #cbd5e1;
}
.auth-footer a {
color: #818cf8;
}
.auth-footer a:hover {
color: #a5b4fc;
/* Auth pages — only override variables, no selector duplication */
.auth-page {
--auth-bg-card: rgba(30, 41, 59, 0.98);
--auth-text-heading: #f1f5f9;
--auth-text-body: #cbd5e1;
--auth-text-link: #818cf8;
--auth-text-link-hover: #a5b4fc;
--auth-border: #334155;
--auth-bg-input: #1e293b;
--auth-shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
--auth-border-card: rgba(255, 255, 255, 0.05);
}
}