Skip to content

Refactor homepage CSS: remove :has(), scope hero, and lock sidebar width#126

Merged
ttuff merged 1 commit intomainfrom
codex/harden-and-simplify-hero/sidebar-implementation
Feb 18, 2026
Merged

Refactor homepage CSS: remove :has(), scope hero, and lock sidebar width#126
ttuff merged 1 commit intomainfrom
codex/harden-and-simplify-hero/sidebar-implementation

Conversation

@ttuff
Copy link
Contributor

@ttuff ttuff commented Feb 18, 2026

Motivation

  • Remove fragile :has() selectors and scope homepage-only styles to a controlled structure so rules cannot leak to other pages.
  • Keep the existing, working hero/header overlap behavior while simplifying selectors and preventing the hero from being positioned beneath the sidebar.
  • Stabilize the sidebar width so it cannot expand and break layout on large screens.

Description

  • Replaced all body:has(...) homepage selectors in docs/styles/extra.css with structure-rooted selectors using .oasis-layout and .oasis-main (content padding, H1 spacing, hero spacing, and kicker styling now scoped to .oasis-layout).
  • Kept the hero flush-to-header rule exactly as requested under .oasis-layout .oasis-main .oasis-hero using margin-top: calc(var(--md-header-height, 3rem) * -1) and padding-top: var(--md-header-height, 3rem).
  • Updated the sidebar width token to --oasis-sidebar-w: 300px and hardened desktop sidebar sizing with overflow: hidden and added .oasis-sidebar * { max-width: 100%; } to prevent children from forcing expansion.
  • Ensured the hero remains confined to .oasis-main and did not reintroduce any 100vw or negative viewport-offset tricks.

Testing

  • Ran rg ':has\(' docs/styles/extra.css and confirmed there are no :has() selectors remaining in the file.
  • Ran mkdocs build successfully (build completes; existing documentation link warnings are pre-existing and unrelated).
  • Launched a local server and captured a visual sanity-check screenshot (mkdocs serve + Playwright screenshot) to verify the hero touches the header, is not under the sidebar, and the sidebar width is stable; visual check succeeded.

Codex Task

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@ttuff ttuff merged commit cf253af into main Feb 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant