feat: theme-adaptive fullscreen background + wire updateMermaidTheme to applyTheme
This commit is contained in:
@@ -13,3 +13,4 @@ build/
|
|||||||
config.json
|
config.json
|
||||||
data/
|
data/
|
||||||
.coverage
|
.coverage
|
||||||
|
.coverage
|
||||||
|
|||||||
@@ -163,6 +163,11 @@ export function applyTheme(theme) {
|
|||||||
darkSheet.disabled = theme !== "dark";
|
darkSheet.disabled = theme !== "dark";
|
||||||
lightSheet.disabled = theme !== "light";
|
lightSheet.disabled = theme !== "light";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update Mermaid theme for newly rendered diagrams
|
||||||
|
import('./mermaid-viewer.js').then(function(m) {
|
||||||
|
m.updateMermaidTheme(theme === 'dark');
|
||||||
|
}).catch(function() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function toggleTheme() {
|
export function toggleTheme() {
|
||||||
|
|||||||
+39
-11
@@ -7706,25 +7706,53 @@ body.popup-mode .content-area {
|
|||||||
/* ── Fullscreen ── */
|
/* ── Fullscreen ── */
|
||||||
.mermaid-fullscreen-overlay {
|
.mermaid-fullscreen-overlay {
|
||||||
position: fixed; top: 0; left: 0; right: 0; bottom: 0;
|
position: fixed; top: 0; left: 0; right: 0; bottom: 0;
|
||||||
z-index: 10000; background: rgba(0,0,0,0.92);
|
z-index: 10000;
|
||||||
display: flex; flex-direction: column;
|
display: flex; flex-direction: column;
|
||||||
}
|
}
|
||||||
|
/* Light theme — clean white like the example */
|
||||||
|
[data-theme="light"] .mermaid-fullscreen-overlay {
|
||||||
|
background: rgba(255,255,255,0.97);
|
||||||
|
}
|
||||||
|
[data-theme="light"] .mermaid-fullscreen-header {
|
||||||
|
background: rgba(0,0,0,0.03);
|
||||||
|
border-bottom: 1px solid rgba(0,0,0,0.08);
|
||||||
|
}
|
||||||
|
[data-theme="light"] .mermaid-fullscreen-header .mermaid-diagram-type {
|
||||||
|
color: rgba(0,0,0,0.5);
|
||||||
|
}
|
||||||
|
[data-theme="light"] .mermaid-fullscreen-header .mermaid-btn {
|
||||||
|
color: rgba(0,0,0,0.4);
|
||||||
|
}
|
||||||
|
[data-theme="light"] .mermaid-fullscreen-header .mermaid-btn:hover {
|
||||||
|
background: rgba(0,0,0,0.05);
|
||||||
|
color: rgba(0,0,0,0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Dark theme */
|
||||||
|
[data-theme="dark"] .mermaid-fullscreen-overlay {
|
||||||
|
background: rgba(18,18,24,0.97);
|
||||||
|
}
|
||||||
|
[data-theme="dark"] .mermaid-fullscreen-header {
|
||||||
|
background: rgba(255,255,255,0.06);
|
||||||
|
border-bottom: 1px solid rgba(255,255,255,0.08);
|
||||||
|
}
|
||||||
|
[data-theme="dark"] .mermaid-fullscreen-header .mermaid-diagram-type {
|
||||||
|
color: rgba(255,255,255,0.7);
|
||||||
|
}
|
||||||
|
[data-theme="dark"] .mermaid-fullscreen-header .mermaid-btn {
|
||||||
|
color: rgba(255,255,255,0.6);
|
||||||
|
}
|
||||||
|
[data-theme="dark"] .mermaid-fullscreen-header .mermaid-btn:hover {
|
||||||
|
background: rgba(255,255,255,0.1);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
.mermaid-fullscreen-header {
|
.mermaid-fullscreen-header {
|
||||||
display: flex; align-items: center; justify-content: space-between;
|
display: flex; align-items: center; justify-content: space-between;
|
||||||
padding: 10px 16px;
|
padding: 10px 16px;
|
||||||
background: rgba(255,255,255,0.06);
|
|
||||||
border-bottom: 1px solid rgba(255,255,255,0.08);
|
|
||||||
min-height: 46px;
|
min-height: 46px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
.mermaid-fullscreen-header .mermaid-diagram-type { color: rgba(255,255,255,0.7); }
|
|
||||||
.mermaid-fullscreen-header .mermaid-btn {
|
|
||||||
color: rgba(255,255,255,0.6);
|
|
||||||
}
|
|
||||||
.mermaid-fullscreen-header .mermaid-btn:hover {
|
|
||||||
background: rgba(255,255,255,0.1);
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.mermaid-fullscreen-content {
|
.mermaid-fullscreen-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex; align-items: center; justify-content: center;
|
display: flex; align-items: center; justify-content: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user