Skip to content

Commit

Permalink
feat: 修订 css 样式,支持更多明暗切换
Browse files Browse the repository at this point in the history
  • Loading branch information
HowieHz committed Dec 11, 2024
1 parent 3037edf commit a1a26ff
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1150,35 +1150,35 @@ article .content text-diagram[data-type="mermaid"] {

/* 自动模式 */
@media (prefers-color-scheme: no-preference) {
html[theme="auto"] article .content div.light,
html[theme="auto"] article .content text-diagram[data-type="mermaid"].light {
html[data-color-scheme="auto"] article .content div.light,
html[data-color-scheme="auto"] article .content text-diagram[data-type="mermaid"].light {
display: block;
}
}

@media (prefers-color-scheme: light) {
html[theme="auto"] article .content div.light,
html[theme="auto"] article .content text-diagram[data-type="mermaid"].light {
html[data-color-scheme="auto"] article .content div.light,
html[data-color-scheme="auto"] article .content text-diagram[data-type="mermaid"].light {
display: block;
}
}

@media (prefers-color-scheme: dark) {
html[theme="auto"] article .content div.dark,
html[theme="auto"] article .content text-diagram[data-type="mermaid"].dark {
html[data-color-scheme="auto"] article .content div.dark,
html[data-color-scheme="auto"] article .content text-diagram[data-type="mermaid"].dark {
display: block;
}
}

/* 明亮模式 */
html[theme="light"] article .content div.light,
html[theme="light"] article .content text-diagram[data-type="mermaid"].light {
html[data-color-scheme="light"] article .content div.light,
html[data-color-scheme="light"] article .content text-diagram[data-type="mermaid"].light {
display: block;
}

/* 暗黑模式 */
html[theme="dark"] article .content div.dark,
html[theme="dark"] article .content text-diagram[data-type="mermaid"].dark {
html[data-color-scheme="dark"] article .content div.dark,
html[data-color-scheme="dark"] article .content text-diagram[data-type="mermaid"].dark {
display: block;
}
/* language-mermaid style end */
Expand Down

0 comments on commit a1a26ff

Please sign in to comment.