fix: align english homepage author grid

Top-align the English homepage author cards, enlarge the row gap, and normalize avatar sizing so author portraits line up consistently.
This commit is contained in:
cydia2001
2026-03-11 01:33:17 +00:00
parent 8cb06c2a8b
commit 8d980295c6
2 changed files with 27 additions and 0 deletions

View File

@@ -41,6 +41,10 @@ h2.toc {
}
.author-item {
max-width: 300px;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.author-item h3 {
padding-top: 25px;
@@ -49,6 +53,17 @@ h2.toc {
.author-item img {
border-radius: 50%;
width: 120px;
height: 120px;
object-fit: cover;
}
.authors.mdl-grid {
align-items: flex-start;
row-gap: calc(24px + 1.5em);
}
.authors .mdl-cell {
display: flex;
align-items: flex-start;
justify-content: center;
}
.authors h4 {
width: 100%;

View File

@@ -7,6 +7,9 @@ from pathlib import Path
from tools.prepare_mdbook import build_title_cache, rewrite_markdown, write_summary
REPO_ROOT = Path(__file__).resolve().parents[1]
class PrepareMdBookTests(unittest.TestCase):
def test_write_summary_skips_placeholder_pages(self) -> None:
with tempfile.TemporaryDirectory() as tmpdir:
@@ -199,6 +202,15 @@ Reference :cite:`smith2024`.
self.assertNotIn('openmlsys-frontpage-switch', rewritten)
def test_english_frontpage_author_grid_uses_top_aligned_spacing(self) -> None:
frontpage = (REPO_ROOT / "en_chapters" / "frontpage.html").read_text(encoding="utf-8")
self.assertIn(".authors.mdl-grid {", frontpage)
self.assertIn("align-items: flex-start;", frontpage)
self.assertIn("row-gap: calc(24px + 1.5em);", frontpage)
self.assertIn("height: 120px;", frontpage)
self.assertIn("object-fit: cover;", frontpage)
if __name__ == "__main__":
unittest.main()