Closed TwoTau closed 2 years ago
This is looking great! I added comments/questions on some of the code changes.
A few additional questions:
inlinenote
(previously just note
) and an aside
? I'm not currently using aside
anywhere in living papers now, so I'm curious what you have in mind here.sticky
attributes, how about sticky-until
(stick until you reach the start of the identified section) and sticky-through
(sticky until you reach the end of the identified section). Does that match your current semantics for sticky-until-top
and sticky-until-bottom
? (And on that note, I'm not sure of the semantics for until-bottom
... does it reason in terms of paper sections or only via specific element id
s?) I'm tempted to keep things simple and use only sticky-until
(top) for now, unless you have some compelling argument otherwise!Also, take a look at this PR, as we'll need to reconcile our approaches: https://github.com/uwdata/living-papers-testbed/pull/9
How valuable is using SCSS? I'm not against it, but would like to keep things as-simple-as-possible unless a change makes a substantial difference in what we can express.
The SCSS features I use most are nested selectors and reusable mixins to organize code. I think the main expressiveness benefit of SCSS is being able to pass variables around, but this is now also possible with CSS variables. I've noticed that programmers tend to use SCSS variables for colors and CSS variables for layout, but I'm not sure why (maybe because of the SCSS's color functions?)
What is the difference between an
inlinenote
(previously justnote
) and anaside
? I'm not currently usingaside
anywhere in living papers now, so I'm curious what you have in mind here.
I mentioned this in a previous comment; I don't think there was a difference. I'll push a commit that renames inlinenote
back to note
For the
sticky
attributes, how aboutsticky-until
(stick until you reach the start of the identified section) andsticky-through
(sticky until you reach the end of the identified section). Does that match your current semantics forsticky-until-top
andsticky-until-bottom
?
Yep, just pushed a commit to change the naming to sticky-until
/sticky-through
.
(And on that note, I'm not sure of the semantics for
until-bottom
... does it reason in terms of paper sections or only via specific elementid
s?) I'm tempted to keep things simple and use onlysticky-until
(top) for now, unless you have some compelling argument otherwise!
Right now, both until-top
and until-bottom
only reason in terms of CSS selectors (#id
s but also harder-to-use selectors like #header ~ p ~ p
). However, I'm guessing most authors would prefer to specify "sticky until the bottom of the current section" or "sticky until the next h1 or h2 heading" without needing to know the heading's ID.
My reasoning for adding a "sticky-through" option was just aesthetic. I think it's more cohesive for the sticky figure to end at the same y-position as the bottom of the last <p>
of the current <section>
instead of the first <p>
of the next <section>
because sections have margins.
Rendered with themes:
.margin
elements down so that they don't intersect .page
width elements.Changes
ACM template theme: https://homes.cs.washington.edu/~vishald/lpub/themes/acm-article/ Normal theme: https://homes.cs.washington.edu/~vishald/lpub/themes/normal/
Things added:
lpub.js
: Outputting to a specific directorystyle.scss
imports the other SCSS fileslayout.scss
handles the layout of the document, like element sizingcommon.scss
contains styles shared between all themes_theme.scss
is autogenerated by the build script, which replaces its content with an import to the document's themethemes/*.scss
contains the themes, each in their own filelayout.md
andacm-template.md
style/assets
into${outputDir}/assets
scroll-manager.js
is the component that manages scrolling/stickiness in runtimeSome open questions:
sticky-until-top
andsticky-until-bottom
are kind of clunky. Wouldsticky-until="#element"
along withsticky-anchor="end"
be better?TODO:
sticky-until-*
references an anchor that doesn't exist (right now, there's a runtime warning in the console)