添加深色模式切换功能,优化样式以支持深色主题

This commit is contained in:
2025-03-06 22:33:49 +08:00
parent 411e3436f1
commit ad6241012a
5 changed files with 95 additions and 6 deletions

View File

@ -7,6 +7,9 @@
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
--background-color: #242424;
--text-color: #3d3d3d;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
@ -18,10 +21,16 @@ a {
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}
.dark {
--background-color: #242424;
--text-color: rgb(228, 228, 228);
}
body {
margin: 0;
display: flex;
@ -42,7 +51,8 @@ button {
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
background-color: var(--background-color);
color: var(--text-color);
cursor: pointer;
transition: border-color 0.25s;
}
@ -77,3 +87,7 @@ button:focus-visible {
background-color: #f9f9f9;
}
}
p,a,h1,h2,h3,h4,h5,h6 {
color: var(--text-color);
}