edwardtufte / tufte-css

Style your webpage like Edward Tufte’s handouts.
https://edwardtufte.github.io/tufte-css/
MIT License
5.99k stars 459 forks source link

Marginnotes don't appear in margin when in a list #117

Closed dmerrick closed 7 years ago

dmerrick commented 7 years ago

I have a marginnote in an unordered list, it looks like this:

<ul>
  <li>Tufte-inspired stylesheet by <a href="https://edwardtufte.github.io/tufte-css/">tufte-css</a><label for="mn-6" class="margin-toggle">⊕</label><input type="checkbox" id="mn-6" class="margin-toggle"><span class="marginnote">Seriously, check out <a href="https://en.wikipedia.org/wiki/Edward_Tufte">Edward Tufte</a> and his work on information design</span></li>
</ul>

Unfortunately, the note text does not appear in the margin. Oddly, when the viewport is shrunk, I can click the "expand" icon and see the note inline, but when I restore the viewport to the original size, the marginnote disappears.

This is the same for sidenotes and unordered lists as well.

crmackay commented 7 years ago

I put your code above in between two paragraphs, and the marginnote showed up...its a bit misaligned, which should be fixed, but I can see it. Can you provide a bit more of a minimal example and perhaps a screen shot of the problem your seeing?

image

dmerrick commented 7 years ago

Thanks for responding, @crmackay!

Here's an example of this happening: https://www.dana.lol/2017/09/26/thanks/

dmerrick commented 7 years ago

Interestingly, if I wrap the <ul> in a <p>, I get this:

demo

The *s come from the fact that this is written in Markdown.

crmackay commented 7 years ago

so the reason appears to be because you do not have your ul and ol elements inside a <section> ... </section> element.

dmerrick commented 7 years ago

Thanks, I was wondering if that was the case. I'm not a CSS guy so it's all kind of a mystery to me!

I added <section> tags and the sidenotes now appear, yay!

The last issue seems to be that the notes aren't aligned with the other notes:

example

jez commented 7 years ago

I think lists in general need a bit of TLC:

daveliepmann commented 7 years ago

I agree that lists need some TLC. I will not have time to look at anything Tufte CSS-related for a couple months at a minimum. PRs welcome, as long as they involve extensive testing to make sure we don't introduce any regressions. :)

jez commented 7 years ago

@dmerrick I have a fix for this in #118. If you could try it out and report whether it fixes the layouting issues you were getting, that'd be great!

dmerrick commented 7 years ago

Seems to work for me!