Skip to content

Commit 5823b51

Browse files
authored
Refactor CSS for theme variables and styles
1 parent 914325a commit 5823b51

File tree

1 file changed

+70
-13
lines changed

1 file changed

+70
-13
lines changed

style.css

Lines changed: 70 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,81 @@
1+
/* ======================
2+
THEME VARIABLES
3+
====================== */
4+
5+
:root {
6+
--bg: #0f172a;
7+
--text: #e5e7eb;
8+
--card: #020617;
9+
--muted: #94a3b8;
10+
--accent: #38bdf8;
11+
--border: #1e293b;
12+
}
13+
14+
[data-theme="light"] {
15+
--bg: #ffffff;
16+
--text: #0f172a;
17+
--card: #f8fafc;
18+
--muted: #475569;
19+
--accent: #2563eb;
20+
--border: #e2e8f0;
21+
}
22+
23+
/* ======================
24+
BASE STYLES
25+
====================== */
26+
27+
* {
28+
box-sizing: border-box;
29+
}
30+
131
body {
2-
font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
3-
background: #0f172a;
4-
color: #e5e7eb;
532
margin: 0;
6-
line-height: 1.6;
33+
font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
34+
background: var(--bg);
35+
color: var(--text);
36+
line-height: 1.7;
37+
transition: background 0.3s ease, color 0.3s ease;
738
}
839

940
header {
1041
text-align: center;
11-
padding: 4rem 1rem;
42+
padding: 4rem 1rem 3rem;
43+
border-bottom: 1px solid var(--border);
1244
}
1345

1446
h1 {
1547
font-size: 3rem;
16-
margin-bottom: 0.5rem;
48+
margin-bottom: 0.3rem;
1749
}
1850

1951
.subtitle {
2052
font-size: 1.3rem;
21-
color: #38bdf8;
53+
color: var(--accent);
2254
}
2355

2456
.tagline {
25-
max-width: 600px;
57+
max-width: 650px;
2658
margin: 1rem auto;
59+
color: var(--muted);
2760
}
2861

2962
.links a {
3063
margin: 0 10px;
31-
color: #38bdf8;
64+
color: var(--accent);
3265
text-decoration: none;
3366
font-weight: 500;
3467
}
3568

3669
section {
3770
max-width: 900px;
3871
margin: auto;
39-
padding: 2rem 1rem;
72+
padding: 2.5rem 1.2rem;
4073
}
4174

4275
h2 {
43-
border-bottom: 1px solid #334155;
76+
border-bottom: 1px solid var(--border);
4477
padding-bottom: 0.5rem;
78+
margin-bottom: 1.5rem;
4579
}
4680

4781
ul {
@@ -50,11 +84,34 @@ ul {
5084
}
5185

5286
li {
53-
margin-bottom: 0.5rem;
87+
margin-bottom: 0.6rem;
5488
}
5589

5690
footer {
5791
text-align: center;
5892
padding: 2rem;
59-
color: #94a3b8;
93+
color: var(--muted);
94+
border-top: 1px solid var(--border);
95+
}
96+
97+
/* ======================
98+
THEME TOGGLE BUTTON
99+
====================== */
100+
101+
.theme-toggle {
102+
position: fixed;
103+
top: 20px;
104+
right: 20px;
105+
background: var(--card);
106+
border: 1px solid var(--border);
107+
color: var(--text);
108+
padding: 8px 14px;
109+
border-radius: 6px;
110+
cursor: pointer;
111+
font-size: 14px;
112+
}
113+
114+
.theme-toggle:hover {
115+
background: var(--accent);
116+
color: #fff;
60117
}

0 commit comments

Comments
 (0)