mirror of
https://github.com/openmlsys/openmlsys-zh.git
synced 2026-03-31 17:32:06 +08:00
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:
@@ -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%;
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user