Skip to content

Commit 245daf0

Browse files
authored
Implement CSS variables for light and dark themes
1 parent 849e390 commit 245daf0

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

assets/css/styles.css

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
/* Global text styling */
2+
/* Tema Default (Light) */
3+
:root {
4+
--bg-color: #fff8e1;
5+
--text-color: #2c2c2c;
6+
}
7+
8+
/* Tema Dark */
9+
[data-theme="dark"] {
10+
--bg-color: #1a1a1a;
11+
--text-color: #f0f0f0;
12+
}
13+
214
body {
3-
background-color: #fff8e1; /* kuning krem lembut */
15+
background-color: var(--bg-color);
16+
color: var(--text-color);
17+
transition: 0.3s; /* Agar transisi warna halus */
18+
/*background-color: #fff8e1; /* kuning krem lembut */
419
font-family: "JetBrains Mono", "Fira Code", monospace;
520
font-size: 16px;
621
line-height: 1.6;
7-
color: #2c2c2c; /* teks abu tua agar mudah dibaca */
22+
/*color: #2c2c2c; /* teks abu tua agar mudah dibaca */
823
margin: 0;
924
padding: 0 1.25rem;
1025
}

0 commit comments

Comments
 (0)