jupyter-book / myst-theme

Packages for creating MyST websites themes using React and Remix
https://jupyter-book.github.io/myst-theme/?path=/docs/components-introduction--docs
MIT License
15 stars 14 forks source link

First known part should not add top margin (article theme) #453

Open stevejpurves opened 2 months ago

stevejpurves commented 2 months ago

Looking at getting consistent alignment, we should consider that elements in the main article (or other nav elements) do not add top margin, but leave layout to the parent component.

for example here, the top margin on the abstract part causes misalignment, and we cannot compensate for that by moving the outline as that is content dependendent, if there were no parts or keyworks, we would have an h1 at the top with no margin and good alignment for the current document outline position.

La Palma Seismicity 2021 - La Palma Earthquakes 🔊 2024-08-22 10-38-05

If the Abstract h2 tag did not add it's margin, everything would be well aligned:

La Palma Seismicity 2021 - La Palma Earthquakes 🔊 2024-08-22 10-35-05

So are we able to do something to ensure that the first element in the main body of content does not introduce a margin? or otherwsise is there a way to ensure alignment to the top of the main grid?

agoose77 commented 2 months ago

@stevejpurves I think part of this is that the h2 for the abstract should not be padded. To my mind, it's a separate styling path to the regular h2 in an article. c.f. https://github.com/jupyter-book/myst-theme/pull/450

I wonder whether we just need to do the same will all of the other elements that can end up in the article body (and use bottom margins if appropriate).