-
-
Notifications
You must be signed in to change notification settings - Fork 9
fix(docs): Mobile styling improvements for landing page #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| // Force dark mode only - completely overrides Starlight's theme system | ||
| --- | ||
|
|
||
| {/* Matches Starlight's inline pattern to prevent FOUC */} | ||
| <script is:inline> | ||
| window.StarlightThemeProvider = (() => { | ||
| // Always force dark mode, ignore localStorage and system preference | ||
| document.documentElement.dataset.theme = 'dark'; | ||
| // Clear any stored theme preference to prevent future interference | ||
| if (typeof localStorage !== 'undefined') { | ||
| localStorage.removeItem('starlight-theme'); | ||
| } | ||
| return { | ||
| updatePickers() { | ||
| // No-op: theme picker is hidden, no updates needed | ||
| }, | ||
| }; | ||
| })(); | ||
| </script> | ||
|
|
||
| {/* Empty template to satisfy any code expecting theme icons */} | ||
| <template id="theme-icons"></template> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,10 +90,17 @@ body { | |
| ========================================================================== */ | ||
|
|
||
| header.header { | ||
| background: rgba(10, 10, 15, 0.8); | ||
| background: rgba(10, 10, 15, 0.95); | ||
| backdrop-filter: blur(12px); | ||
| border-bottom: none; | ||
| position: relative; | ||
| } | ||
|
|
||
| /* Ensure hamburger menu button is visible and properly styled */ | ||
| starlight-menu-button button { | ||
| background-color: #1a1a1f !important; | ||
| color: #fff !important; | ||
| border: 1px solid rgba(255, 255, 255, 0.2) !important; | ||
| box-shadow: none !important; | ||
| } | ||
|
|
||
| /* Logo size - larger */ | ||
|
|
@@ -439,12 +446,15 @@ starlight-tabs [role="tabpanel"] { | |
| flex: 0 0 55%; | ||
| min-height: 420px; | ||
| margin: 0.5rem 0.75rem 0.75rem 0; | ||
| padding: 10%; | ||
| background-size: cover; | ||
| background-position: center; | ||
| border-radius: 8px; | ||
| border: 1px solid rgba(255, 255, 255, 0.1); | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| .feature-section-inner.reverse .feature-visual { | ||
|
|
@@ -483,13 +493,31 @@ starlight-tabs [role="tabpanel"] { | |
|
|
||
| .feature-visual { | ||
| min-height: 340px; | ||
| margin: 0 0.5rem 0.5rem 0.5rem; | ||
| padding: 8%; | ||
| } | ||
|
|
||
| .feature-text h3 { | ||
| font-size: 1.4rem; | ||
| } | ||
| } | ||
|
|
||
| @media (max-width: 480px) { | ||
| .feature-visual { | ||
| margin: 0 0.5rem 0.5rem 0.5rem; | ||
| min-height: 300px; | ||
| padding: 6%; | ||
| } | ||
|
|
||
| .feature-text { | ||
| padding: 1.25rem; | ||
| } | ||
|
|
||
| .feature-text h3 { | ||
| font-size: 1.25rem; | ||
| } | ||
| } | ||
|
|
||
| .features-section-new h2 { | ||
| font-size: 1.75rem; | ||
| font-weight: 600; | ||
|
|
@@ -1578,6 +1606,114 @@ nav.sidebar a[aria-current="page"] { | |
| .why-section ul { | ||
| grid-template-columns: 1fr; | ||
| } | ||
|
|
||
| /* Reset search bar to flow naturally in header */ | ||
| site-search button { | ||
| position: static !important; | ||
| transform: none !important; | ||
| width: auto !important; | ||
| min-width: auto !important; | ||
| padding: 0.5rem !important; | ||
| } | ||
|
|
||
| /* Hide search text and kbd shortcut on mobile */ | ||
| site-search button span, | ||
| site-search button kbd { | ||
| display: none !important; | ||
| } | ||
| } | ||
|
|
||
| /* ========================================================================== | ||
| Force Dark Mode Globally | ||
| Ensures dark theme even if JS fails or system preference leaks through | ||
| ========================================================================== */ | ||
|
|
||
| :root { | ||
| color-scheme: dark !important; | ||
| } | ||
|
|
||
| :root, | ||
| :root[data-theme="light"] { | ||
| --sl-color-bg: #0a0a0f !important; | ||
| --sl-color-bg-nav: #0a0a0f !important; | ||
| --sl-color-bg-sidebar: #0a0a0f !important; | ||
| --sl-color-black: #0a0a0f !important; | ||
| --sl-color-white: #ffffff !important; | ||
| --sl-color-text: rgba(255, 255, 255, 0.9) !important; | ||
| --sl-color-text-accent: #ffffff !important; | ||
| --sl-color-gray-1: #e0e0e0 !important; | ||
| --sl-color-gray-2: #c0c0c0 !important; | ||
| --sl-color-gray-3: #888888 !important; | ||
| --sl-color-gray-4: #555555 !important; | ||
| --sl-color-gray-5: #333333 !important; | ||
| --sl-color-gray-6: #1a1a1a !important; | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gray scale values override original "BOOSTED CONTRAST" designMedium Severity The new "Force Dark Mode Globally" CSS section uses the selector |
||
|
|
||
| /* Mobile Table of Contents - Force Dark Theme */ | ||
| mobile-starlight-toc { | ||
| --sl-color-black: #0a0a0f !important; | ||
| --sl-color-white: #ffffff !important; | ||
| } | ||
|
|
||
| mobile-starlight-toc nav, | ||
| mobile-starlight-toc summary, | ||
| mobile-starlight-toc .toggle { | ||
| background-color: #0a0a0f !important; | ||
| border-color: rgba(255, 255, 255, 0.1) !important; | ||
| } | ||
|
|
||
| mobile-starlight-toc .toggle { | ||
| color: #ffffff !important; | ||
| border-color: rgba(255, 255, 255, 0.2) !important; | ||
| } | ||
|
|
||
| mobile-starlight-toc .toggle:hover { | ||
| border-color: rgba(255, 255, 255, 0.3) !important; | ||
| } | ||
|
|
||
| mobile-starlight-toc .display-current { | ||
| color: rgba(255, 255, 255, 0.9) !important; | ||
| } | ||
|
|
||
| mobile-starlight-toc .dropdown { | ||
| background-color: #0a0a0f !important; | ||
| border-color: rgba(255, 255, 255, 0.1) !important; | ||
| } | ||
|
|
||
| mobile-starlight-toc a { | ||
| color: rgba(255, 255, 255, 0.7) !important; | ||
| } | ||
|
|
||
| mobile-starlight-toc a:hover { | ||
| color: #ffffff !important; | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overlapping mobile TOC styles target same elementsLow Severity Two separate styling blocks target the mobile table of contents with overlapping selectors: Additional Locations (1) |
||
|
|
||
| /* Mobile TOC Summary - Direct targeting for light mode override */ | ||
| summary#starlight__on-this-page--mobile, | ||
| summary[id="starlight__on-this-page--mobile"] { | ||
| background-color: #0a0a0f !important; | ||
| border: 1px solid rgba(255, 255, 255, 0.1) !important; | ||
| border-radius: 8px !important; | ||
| color: #ffffff !important; | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Redundant ID and attribute selectors target same elementLow Severity The selectors use both Additional Locations (1) |
||
|
|
||
| summary#starlight__on-this-page--mobile .toggle, | ||
| summary[id="starlight__on-this-page--mobile"] .toggle { | ||
| background-color: transparent !important; | ||
| color: #ffffff !important; | ||
| } | ||
|
|
||
| summary#starlight__on-this-page--mobile .display-current, | ||
| summary[id="starlight__on-this-page--mobile"] .display-current { | ||
| color: rgba(255, 255, 255, 0.7) !important; | ||
| } | ||
|
|
||
| summary#starlight__on-this-page--mobile svg, | ||
| summary[id="starlight__on-this-page--mobile"] svg, | ||
| summary#starlight__on-this-page--mobile .caret, | ||
| summary[id="starlight__on-this-page--mobile"] .caret { | ||
| color: rgba(255, 255, 255, 0.5) !important; | ||
| fill: rgba(255, 255, 255, 0.5) !important; | ||
| } | ||
|
|
||
| /* ========================================================================== | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate color-scheme declaration in CSS file
Low Severity
The declaration
color-scheme: dark !important;is duplicated in the same file - once at line 10 within the original:root, html, html[data-theme="light"], html[data-theme="dark"]block, and again at line 1632 in a new:rootblock. This redundancy increases maintenance burden as both need to be updated together if changes are needed.Additional Locations (1)
docs/src/styles/custom.css#L5-L11