Skip to content

Commit 6baec05

Browse files
committed
Quartz sync: Jun 1, 2025, 11:34 PM
1 parent 529bb20 commit 6baec05

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

quartz/components/scripts/mindmap.inline.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,13 @@ function cleanupGlobalMindmaps() {
213213

214214
document.addEventListener("nav", async () => {
215215

216+
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)
217+
216218
async function renderLocalMindmap() {
217219
cleanupLocalMindmaps()
218220
const mindmapContainers = document.getElementsByClassName("mindmap-container")
219221
for (const container of mindmapContainers) {
222+
isSafari && container.classList.add("is-safari")
220223
localMindmapCleanups.push(await renderMindmap(container as HTMLElement))
221224
}
222225
}
@@ -243,6 +246,7 @@ document.addEventListener("nav", async () => {
243246
const mindmapContainer = container.querySelector(".global-mindmap-container") as HTMLElement
244247
registerEscapeHandler(container, hideGlobalMindmap)
245248
if (mindmapContainer) {
249+
isSafari && mindmapContainer.classList.add("is-safari")
246250
globalMindmapCleanups.push(await renderMindmap(mindmapContainer))
247251
}
248252
}

quartz/components/styles/mindmap.scss

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@
3333
}
3434

3535
blockquote {
36-
max-width: 640px;
37-
width: auto;
36+
width: auto !important;
37+
max-width: 640px !important;
3838
margin-bottom: .1em;
3939

40+
.callout-icon {
41+
margin: auto 0;
42+
}
43+
4044
.callout-content {
4145
padding-bottom: .5em;
4246
}
@@ -68,6 +72,21 @@
6872
}
6973
}
7074

75+
76+
.is-safari {
77+
.markmap {
78+
.callout-icon {
79+
-webkit-mask-image: none !important;
80+
mask-image: none !important;
81+
background-image: var(--callout-icon) !important;
82+
background-repeat: no-repeat;
83+
background-color: unset !important;
84+
background-size: contain;
85+
background-position: center;
86+
}
87+
}
88+
}
89+
7190
.mindmap-toolbar {
7291
position: absolute;
7392
top: 10;

quartz/plugins/transformers/mindmap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function calloutReplacement() {
141141
const typeClass = canonicalizeCallout(type.toLowerCase())
142142
const contents = remain.replace(/<br\s*\/?>/g, "")
143143
return `
144-
<blockquote class="callout ${typeClass}" data-callout="${typeClass}" style="max-width: 640px; width: auto;">
144+
<blockquote class="callout ${typeClass}" data-callout="${typeClass}">
145145
<div class="callout-title">
146146
<div class="callout-icon"></div>
147147
<div class="callout-title-inner"><p>${type}</p></div>

0 commit comments

Comments
 (0)