Skip to content

Commit 986fdc1

Browse files
committed
Fix marginnote position
1 parent 9ebf698 commit 986fdc1

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

www/styles.scss

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ img {
325325
float: right;
326326
clear: right;
327327
margin-right: -60%;
328-
width: 100%;
328+
width: 50%;
329329
margin-top: 0;
330330
margin-bottom: 0;
331331
font-size: 1.1rem;
@@ -334,6 +334,45 @@ img {
334334
position: relative;
335335
}
336336

337+
/* Quarto-specific margin note fixes */
338+
.quarto-container-page .marginnote {
339+
position: absolute;
340+
right: -250px;
341+
width: 200px;
342+
margin-right: 0;
343+
font-size: 0.9rem;
344+
line-height: 1.4;
345+
padding: 0.5rem;
346+
background: transparent;
347+
float: none;
348+
}
349+
350+
/* Ensure parent has relative positioning */
351+
.quarto-container-page p:has(.marginnote) {
352+
position: relative;
353+
}
354+
355+
/* Handle overflow and ensure margin notes don't cause horizontal scroll */
356+
.quarto-container-page {
357+
overflow-x: hidden;
358+
}
359+
360+
/* Adjust margin notes for narrower screens */
361+
@media (max-width: 1400px) {
362+
.quarto-container-page .marginnote {
363+
right: -200px;
364+
width: 180px;
365+
}
366+
}
367+
368+
@media (max-width: 1200px) {
369+
.quarto-container-page .marginnote {
370+
right: -180px;
371+
width: 160px;
372+
font-size: 0.85rem;
373+
}
374+
}
375+
337376
.table-caption {
338377
float:right;
339378
clear:right;
@@ -540,6 +579,14 @@ label.margin-toggle:not(.sidenote-number) { display: none; }
540579
margin-left: 0;
541580
padding: 4px;
542581
}
582+
583+
/* Override Quarto-specific styles on mobile */
584+
.quarto-container-page .marginnote {
585+
position: relative;
586+
right: auto;
587+
width: 95%;
588+
margin: 1rem 2.5%;
589+
}
543590
}
544591

545592
/* Style activated by the addition of the lightbox selection class */

0 commit comments

Comments
 (0)