This is the canonical guide for homepage layout behavior, homepage CSS scoping, and Codex-safe editing patterns.
Use this before touching:
docs/index.mddocs/styles/extra.cssdocs/assets/css/style.cssdocs/overrides/main.htmlmkdocs.yml
- The homepage uses a persistent two-column wrapper:
.oasis-layoutcontaining.oasis-sidebar(tags) +.oasis-main(main content). - The hero block (banner) MUST live inside
.oasis-layout > .oasis-mainto prevent overlap. - Sidebar width is controlled by
--oasis-sidebar-w(currently300px) and is enforced at desktop widths via flex sizing. - Sidebar expansion is prevented via
overflow: hiddenandmax-width: 100%on descendants.
Keep the homepage shell in this form:
<div class="oasis-layout" markdown="1">
<aside class="oasis-sidebar" markdown="1">...</aside>
<main class="oasis-main" markdown="1">
<div class="esiil-banner oasis-hero" markdown="1">...</div>
...main homepage content...
</main>
</div>- The hero is “flush to header” using this scoped rule:
.oasis-layout .oasis-main .oasis-hero {
margin-top: calc(var(--md-header-height, 3rem) * -1);
padding-top: var(--md-header-height, 3rem);
}- We removed/avoided
100vwfull-bleed hero sizing and anymargin-left: calc(50% - 50vw)tricks, because those caused hero underlap with the sidebar. - If a pseudo-element is used for hero backgrounds, it must be confined to
.oasis-main(not viewport width).
- Do NOT use
:has()for homepage scoping (brittle + can silently fail in tooling and cause no-ops). - Prefer scoping homepage-only rules using
.oasis-layoutas the homepage hook, since it only exists onindex.md. - For the white strip issue, do not target Material ancestor containers from inside
.oasis-layout; those selectors cannot match.
The visible white strip above the hero comes from MkDocs Material top padding on ancestor containers (for example, .md-content__inner). Since those containers are ancestors of homepage content, they cannot be reliably and safely overridden with descendant selectors from .oasis-layout without introducing brittle approaches.
Our chosen fix is to cancel that inherited top gap at the first homepage wrapper we control:
.oasis-layout {
margin-top: calc(var(--oasis-home-top-gap) * -1);
padding-top: var(--oasis-home-top-gap);
}This keeps homepage behavior explicit, structural, and maintainable while preserving internal layout flow.
docs/styles/extra.cssis the final-authority brand skin layer.docs/assets/css/style.cssshould only contain legacy structural quirks (layout scaffolding), not aesthetic styling.- Rule of thumb:
- Visual/brand rule (color, surface, typography, polish, hero visual treatment) ➜
extra.css - Structural compatibility glue (legacy selectors needed for behavior/layout compatibility) ➜
style.css
- Visual/brand rule (color, surface, typography, polish, hero visual treatment) ➜
Rationale: separating aesthetic intent from compatibility glue lowers regression risk when updating homepage visuals.
- Confirm hero negative margin/padding rule still exists on
.oasis-layout .oasis-main .oasis-hero. - Confirm
.oasis-layouttop-gap cancellation is present (margin-topnegative + matchingpadding-top).
- Confirm hero remains inside
.oasis-mainindocs/index.md. - Confirm no
100vworcalc(50% - 50vw)hero sizing rules were introduced. - Confirm pseudo-element backgrounds are restricted to
.oasis-mainbounds.
- Check the value of
--oasis-home-top-gapindocs/styles/extra.css. - Confirm it matches current Material top padding at the active breakpoint.
- If needed, adjust the variable value or add a breakpoint override for
--oasis-home-top-gap.
Do not reintroduce :has() or dead descendant selectors that try to target ancestor containers.
- Check
--oasis-sidebar-windocs/styles/extra.css. - Check desktop flex-basis rule on
.oasis-sidebar. - Check
overflow: hiddenand descendantmax-width: 100%rules.
Update the homepage hero styling in docs/styles/extra.css.
Constraints:
- Homepage-only changes (scope via .oasis-layout)
- Do not use :has()
- Keep hero inside .oasis-layout > .oasis-main
- Preserve flush-header rule on .oasis-layout .oasis-main .oasis-hero
- Do not use 100vw or calc(50% - 50vw)
Validation:
- Run mkdocs build and mkdocs serve commands
- Report exactly which container padding resets were touched
Change homepage sidebar width by editing --oasis-sidebar-w in docs/styles/extra.css.
Constraints:
- Homepage-only changes (scope via .oasis-layout)
- Do not use :has()
- Keep .oasis-sidebar flex-basis and width in sync with --oasis-sidebar-w
- Keep overflow: hidden and descendant max-width: 100%
Validation:
- Run mkdocs build and mkdocs serve commands
- Confirm hero does not overlap sidebar at desktop widths
Update the homepage hero background image/overlay in docs/styles/extra.css.
Constraints:
- Homepage-only changes (scope via .oasis-layout)
- Do not use :has()
- Keep .oasis-layout/.oasis-main structure unchanged
- Do not introduce 100vw full-bleed or calc(50% - 50vw) rules
- If using pseudo-elements, keep them confined to .oasis-main
Validation:
- Run mkdocs build and mkdocs serve commands
- Verify no white strip above hero
Propose (do not apply) experiments for header + Safari theme tint behavior.
Constraints:
- Notes only; no functional CSS layout refactor
- Keep homepage rules scoped via .oasis-layout
- Avoid :has()
- Respect existing .oasis-layout/.oasis-main hero placement and flush-header rule
Output:
- 2-3 safe options with rollback notes
- Include mkdocs build/serve validation plan
We iterated through homepage regressions (white top gap, hero/sidebar overlap, redundant sidebar layers, brittle selector scope) and stabilized on a layout-anchored approach:
- homepage hook =
.oasis-layout - hero constrained to
.oasis-main - white-gap cancellation handled at
.oasis-layoutusing--oasis-home-top-gap(negative margin + matching padding) - explicit split between brand skin (
extra.css) and legacy structure glue (style.css)
This guide exists to preserve those decisions and prevent repeating the same regressions.
- GitHub Pages deploys this site under
/home/, butmkdocs serveruns the homepage at/locally. - Do not test local homepage behavior at
/home/; use/when validating layout fixes.