File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed
Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -213,10 +213,13 @@ function cleanupGlobalMindmaps() {
213213
214214document . addEventListener ( "nav" , async ( ) => {
215215
216+ const isSafari = / ^ ( (? ! c h r o m e | a n d r o i d ) .) * s a f a r i / 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 }
Original file line number Diff line number Diff line change 3333 }
3434
3535 blockquote {
36- max- width : 640 px ;
37- width : auto ;
36+ width : auto !important ;
37+ max- width : 640 px !important ;
3838 margin-bottom : .1em ;
3939
40+ .callout-icon {
41+ margin : auto 0 ;
42+ }
43+
4044 .callout-content {
4145 padding-bottom : .5em ;
4246 }
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 ;
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ function calloutReplacement() {
141141 const typeClass = canonicalizeCallout ( type . toLowerCase ( ) )
142142 const contents = remain . replace ( / < b r \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>
You can’t perform that action at this time.
0 commit comments