Skip to content

Commit ad6fdbc

Browse files
committed
不需要优化明暗切换
1 parent 6230bd0 commit ad6fdbc

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

themes/Zebin-Theme/layout/layout.ejs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
<!DOCTYPE html>
22
<html lang="zh-CN">
33
<head>
4-
<script>
5-
if (localStorage.getItem('theme') === 'dark' || (!localStorage.getItem('theme') && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
6-
document.documentElement.setAttribute('data-theme', 'dark');
7-
}
8-
</script>
94
<meta charset="UTF-8">
105
<meta name="viewport" content="width=device-width, initial-scale=1.0">
116
<title><%- page.title ? page.title + ' | ' + config.title : config.title %></title>

themes/Zebin-Theme/source/css/style.css

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -545,19 +545,21 @@ body {
545545
}
546546

547547
/* =========================================
548-
2. 全局平滑过渡动画 (GPU 性能优化版)
548+
2. 全局平滑过渡动画 (GPU 性能优化版) !!!不需要优化
549549
========================================= */
550-
/* 🎯 仅对大面积的背景容器应用背景色和阴影过渡,避免 GPU 瞬间过载崩溃 */
550+
/* 🎯 仅对大面积的背景容器应用背景色和阴影过渡,避免 GPU 瞬间过载崩溃
551551
body, .sidebar-left, .sidebar-right, .content-mid, .post-card, .widget, .card, .calendar-container {
552552
transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
553553
}
554+
*/
554555

555-
/* 🎯 文字颜色变化极快,不需要过渡动画,直接瞬间切换反而更干脆清晰 */
556+
/* 🎯 文字颜色变化极快,不需要过渡动画,直接瞬间切换反而更干脆清晰
556557
body {
557558
color: var(--text-main);
558559
}
559-
560-
/* 🎯 仅对带有交互的链接和按钮保留综合过渡 */
560+
*/
561+
/* 🎯 仅对带有交互的链接和按钮保留综合过渡
561562
a, button, .read-more, .theme-toggle {
562563
transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
563-
}
564+
}
565+
*/

0 commit comments

Comments
 (0)