apas / athena

Minimalist static blog generator written in Python
https://apas.github.io/athena/
341 stars 23 forks source link

Fix: appearance of side/margin notes on small screens #8

Closed f--f closed 6 years ago

f--f commented 6 years ago

I recently discovered this project and it looks pretty nifty. I just noticed a couple of issues when for mobile devices specifically (small widths) that I've tried to fix:

I believe this occurs since the notes are floating elements and can "escape" their parent block. I've resolved it by simply adding overflow: hidden to paragraphs (e.g. as seen here) on small screens.

apas commented 6 years ago

Thanks, looks nice. Can't pull yet because it breaks figure captions and footer (see attached screenshots.) If you can fix it, I'll have another look.

screenshot 2017-11-27 11 44 22 screenshot 2017-11-27 11 44 37 screenshot 2017-11-27 11 45 02 vs screenshot 2017-11-27 11 46 48 screenshot 2017-11-27 11 46 35 screenshot 2017-11-27 11 46 19

f--f commented 6 years ago

Oops, my bad :) I've added back the .marginnote { float: none; } rule to fix the alignment issues and made it so margin notes inside figures are visible.

apas commented 6 years ago

Figure captions still not rendered properly.

f--f commented 6 years ago

They're showing up for me in Chrome and Firefox. Did I overlook something?

ex3

apas commented 6 years ago

Safari 11.0.1 (High Sierra) is the culprit then.

f--f commented 6 years ago

I'm guessing the priority for the display property might be different then. Unfortunately I don't have any devices which I can use to test with Safari, but I think changing lines 353-354 from

figure .marginnote { display: inline; }
.sidenote, .marginnote { display: none; }

to

.sidenote, p .marginnote { display: none; }

(etc., for other elements where margin notes should be hidden) might work, if the problem is that the figure captions are still hidden.

I don't want to speculate without testing it though, so please feel free to take over if you'd like.

apas commented 6 years ago

I'll have a look and will report back, thanks.

f--f commented 6 years ago

I think I figured it out, seems like it's a Pandoc 1.x vs 2.x issue. I have Pandoc 2.x on my system, which generates marginnotes within a figure block, but 1.x appears to generate them in a div block with a figure class, so the selector wasn't working.

Hoping that resolves the issue!

apas commented 6 years ago

Tested on Safari with both Pandoc 1.19.x and 2.x; looks good to me, will merge. Thanks for the patch.