mirror of
https://github.com/openmlsys/openmlsys-zh.git
synced 2026-04-01 09:50:23 +08:00
fix: widen homepage main content area
Apply a homepage-only override so mdbook-content > main uses at least 80% of the available content width while keeping normal body pages on the default layout.
This commit is contained in:
@@ -192,7 +192,10 @@ Reference :cite:`smith2024`.
|
||||
self.assertIn("padding: 0 !important;", rewritten)
|
||||
self.assertIn("border-radius: 6px;", rewritten)
|
||||
self.assertIn("background: #f6f8fa;", rewritten)
|
||||
self.assertIn("width: min(100%, max(80%, var(--content-max-width)));", rewritten)
|
||||
self.assertIn(".content main {", rewritten)
|
||||
self.assertIn("max-width: min(100%, max(80%, var(--content-max-width)));", rewritten)
|
||||
self.assertIn(".openmlsys-frontpage {", rewritten)
|
||||
self.assertIn("width: 100%;", rewritten)
|
||||
self.assertIn("margin-inline: auto;", rewritten)
|
||||
|
||||
def test_regular_page_does_not_render_frontpage_switch(self) -> None:
|
||||
|
||||
@@ -25,7 +25,7 @@ FRONTPAGE_SWITCH_PLACEHOLDER = "<!-- OPENMLSYS_LANGUAGE_SWITCH -->"
|
||||
FRONTPAGE_LAYOUT_CSS = """
|
||||
<style>
|
||||
.openmlsys-frontpage {
|
||||
width: min(100%, max(80%, var(--content-max-width)));
|
||||
width: 100%;
|
||||
margin: 0 auto 3rem;
|
||||
margin-inline: auto;
|
||||
}
|
||||
@@ -101,6 +101,9 @@ FRONTPAGE_LAYOUT_CSS = """
|
||||
max-width: 960px;
|
||||
margin-inline: auto;
|
||||
}
|
||||
.content main {
|
||||
max-width: min(100%, max(80%, var(--content-max-width)));
|
||||
}
|
||||
@media (max-width: 1000px) {
|
||||
.openmlsys-frontpage .mdl-cell,
|
||||
.openmlsys-frontpage .mdl-cell--1-col,
|
||||
|
||||
Reference in New Issue
Block a user