News for hackers. Stuff that matters.
Re:Tufte CSS by kmfrk on Wednesday August 05, 2015 @05:41PM (#10013067)
I've always taken a liking to sidenotes, but the main problem with them is they are complicated by Markdown's rendering of footnotes.

It's great for many other purposes, but a lot of people will probably prefer doing things in Markdown.

Re:Tufte CSS by munificent on Wednesday August 05, 2015 @06:31PM (#10013342)
I use sidenotes very heavily in my book[1], which is written in Markdown[2]. Instead of putting the contents of the asides in the middle of a paragraph, I pull them out into separate <aside> tags. Inside the paragraph, I have a little <span> with a name to indicate which text the <aside> should be positioned to line up with.

There is some CSS to put the asides on the side[3] (with a ton of variations to make it play nice on mobile). Then there's a bit of JS to correctly line them up with <span> markers[4]. It was a bit more effort than I expected, and I don't like having to rely on JS, but the output is really nice, I think.

For example, take a look at this chapter[5], and try resizing your browser window or hitting it on a mobile device.

[1]: http://gameprogrammingpatterns.com/

[2]: https://github.com/munificent/game-programming-patterns/blob...

[3]: https://github.com/munificent/game-programming-patterns/blob...

[4]: https://github.com/munificent/game-programming-patterns/blob...

[5]: http://gameprogrammingpatterns.com/double-buffer.html

Re:Tufte CSS by saidajigumi on Wednesday August 05, 2015 @07:21PM (#10013568)
I like how your asides move into paragraph flow as the page narrows. The Tufte CSS page hides the sidebar content completely as the page narrows, which eliminates access to crucial information.

(Aside: I really love using the Mobile Design View in Firefox and Chrome for inspecting responsive behavior. You can drag the viewport size by hand, or switch it to presets that represent target devices easily. All while keeping the full width of the browser pane for developer/inspector UI. FF even has a nice toggle shortcut, ⌥⌘M on OS X.)

Re:Tufte CSS by munificent on Wednesday August 05, 2015 @08:16PM (#10013860)
> I like how your asides move into paragraph flow as the page narrows.

Yup. This is a nice (deliberate) side effect of using separate <aside> blocks instead of jamming them in the middle of the paragraph. The original location of the <aside> tag determines where the sidebar appears in the text flow if there's no room for it on the side. In some cases, it may be a few paragraphs distant from where it shows up on the side if that leads to better reading.

This is also the fallback for users who don't have JS enabled. (Well, all both of them, at this point.)

> I really love using the Mobile Design View in Firefox and Chrome for inspecting responsive behavior.

Oh, yeah. I basically lived in that for a few days when I was tweaking the CSS.

Re:Tufte CSS by hftf on Wednesday August 05, 2015 @07:41PM (#10013664)
I’ve seen Tufte CSS before when I tried to search for HTML/CSS sidenote implementations. I’m happy to see a responsive one, even though it uses JS.
Re:Tufte CSS by dredmorbius on Wednesday August 05, 2015 @07:59PM (#10013767)
Another responsive sidenote implementation, screenshots:

http://imgur.com/a/TXpis

Re:Tufte CSS by hftf on Wednesday August 05, 2015 @08:30PM (#10013908)
> screenshots

What help. /s

Re:Tufte CSS by dredmorbius on Thursday August 06, 2015 @01:10AM (#10014652)
Basic sidenotes http://codepen.io/dredmorbius/pen/OVmKZX?editors=110

Not responsive, but @media queries on width and re-scaling width, margin, background colour, and border colour is what gets you that.

Motherfucking Website. No sidenotes. but other bones of my basic design. http://codepen.io/dredmorbius/pen/KpMqqB

Daniel Bos's sidenote implementation: http://loadingdata.nl/waves/

(Degrades nicely for non-CSS viewers, not responsive.)

Re:Tufte CSS by dredmorbius on Wednesday August 05, 2015 @10:38PM (#10014246)
It's not ready for prime time. I thought I'd posted some sample code. I'll dig for it. That was while I was doing anonymous codepens, so they're not on my profile there.

Searching "css sidenote edward morbius" on G+ might turn up something and basic CSS.