Skip to content

Commit b5c91cc

Browse files
rorarclaude
andcommitted
fix: dark/light mode compatibility for fullscreen controls
- Close button: use theme CSS vars (--md-default-bg-color, --md-default-fg-color) instead of hardcoded rgba — adapts to both light mode (dark text on light bg) and dark mode (light text on dark bg) - Remove duplicate margin-top on expand button - Expand button hover: use CSS var for text color Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 435bea3 commit b5c91cc

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

docs/stylesheets/extra.css

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,9 @@
110110
/* Mermaid fullscreen button (inserted as sibling after .mermaid element) */
111111
.mermaid-expand-btn {
112112
display: flex;
113-
margin: 0.5rem auto 0;
114113
align-items: center;
115114
gap: 0.3rem;
116-
margin-top: 0.5rem;
115+
margin: 0.5rem auto 0;
117116
padding: 0.3rem 0.8rem;
118117
border: 1px solid var(--md-accent-fg-color);
119118
border-radius: 4px;
@@ -126,7 +125,7 @@
126125

127126
.mermaid-expand-btn:hover {
128127
background: var(--md-accent-fg-color);
129-
color: #fff;
128+
color: var(--md-accent-fg-color--transparent, #fff);
130129
}
131130

132131
/* Mermaid element in native fullscreen mode */
@@ -140,21 +139,23 @@
140139
position: relative;
141140
}
142141

142+
/* Close button — adapts to light/dark mode */
143143
.mermaid-close-btn {
144144
position: fixed;
145145
top: 1rem;
146146
right: 1rem;
147147
z-index: 1;
148148
padding: 0.4rem 1rem;
149-
border: none;
149+
border: 1px solid var(--md-default-fg-color--lighter);
150150
border-radius: 6px;
151-
background: rgba(0, 0, 0, 0.6);
152-
color: #fff;
151+
background: var(--md-default-bg-color, #fff);
152+
color: var(--md-default-fg-color, #333);
153153
font-size: 0.85rem;
154154
cursor: pointer;
155-
transition: background 0.15s;
155+
opacity: 0.85;
156+
transition: opacity 0.15s;
156157
}
157158

158159
.mermaid-close-btn:hover {
159-
background: rgba(0, 0, 0, 0.85);
160+
opacity: 1;
160161
}

0 commit comments

Comments
 (0)