Skip to content

Commit

Permalink
Adjust the light and dark theme of UI button in open popup
Browse files Browse the repository at this point in the history
  • Loading branch information
gitcpy authored Sep 22, 2024
1 parent 5f95191 commit 28b8127
Showing 1 changed file with 35 additions and 10 deletions.
45 changes: 35 additions & 10 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@
padding: 5px;
cursor: pointer;
font-size: 16px;
color: rgb(0 0 0 / 52%); /* Correct color */
}

.control-button:hover {
background: rgba(255, 255, 255, 0.9);
}

.arrow-up, .arrow-down, .arrow-left, .arrow-right, .zoom-in, .zoom-out, .close-popup {
width: 30px;
height: 30px;
Expand All @@ -60,17 +61,45 @@
align-items: center;
}

/* 按钮的 hover 样式 */
.arrow-up:hover, .arrow-down:hover, .arrow-left:hover, .arrow-right:hover,
.zoom-in:hover, .zoom-out:hover, .close-popup:hover {
background-color: var(--button-bg-hover);
color: var(--button-color-hover);
}

/* 浅色主题 */
@media (prefers-color-scheme: light) {
:root {
--button-bg: #e0e0e0; /* 浅色主题的按钮背景色 */
--button-color: #000; /* 浅色主题的按钮文字或图标颜色 */
--button-bg-hover: #d0d0d0; /* 浅色主题的按钮 hover 背景色 */
--button-color-hover: #333; /* 浅色主题的按钮 hover 文字或图标颜色 */
}
}

/* 深色主题 */
@media (prefers-color-scheme: dark) {
:root {
--button-bg: #333; /* 深色主题的按钮背景色 */
--button-color: #fff; /* 深色主题的按钮文字或图标颜色 */
--button-bg-hover: #606060; /* 深色主题的按钮 hover 背景色 */
--button-color-hover: #000; /* 深色主题的按钮 hover 文字或图标颜色 */
}
}


/* 浅色模式下的弹窗背景 */
body.theme-light .popup-content {
background-color: #ffffff; /* 白色背景 */
color: #000000; /* 黑色文本 */
}

/* 深色模式下的弹窗背景 */
body.theme-dark .popup-content {
background-color: #333333; /* 深灰色背景 */
color: #ffffff; /* 白色文本 */
}
/* 深色模式下的弹窗背景 */
body.theme-dark .popup-content {
background-color: #333333; /* 深灰色背景 */
color: #ffffff; /* 白色文本 */
}

.mermaid {
display: block;
Expand All @@ -83,10 +112,6 @@ body.theme-light .popup-content {
max-height: 100%;
}

.control-button {
color: var(--text-normal)
}

.popup-content {
cursor: pointer; /* 悬停时鼠标变为手掌 */
}
Expand Down

0 comments on commit 28b8127

Please sign in to comment.