Skip to content

Commit 9f8c5db

Browse files
committed
fix
1 parent 85e074f commit 9f8c5db

5 files changed

Lines changed: 40 additions & 4 deletions

File tree

website/src/components/MobileHeader.astro

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ const tocHeadings = headings.filter((h) => h.depth === 2 || h.depth === 3);
173173
align-items: center;
174174
justify-content: space-between;
175175
gap: var(--mobile-header-gap);
176+
/* Performance optimizations for fixed positioning */
177+
will-change: transform;
178+
contain: layout style paint;
179+
isolation: isolate;
176180
}
177181

178182
@media (max-width: 768px) {
@@ -294,6 +298,9 @@ const tocHeadings = headings.filter((h) => h.depth === 2 || h.depth === 3);
294298
opacity: 0;
295299
pointer-events: none;
296300
transition: opacity var(--transition-normal);
301+
/* Performance optimizations for dynamic visibility */
302+
will-change: opacity;
303+
isolation: isolate;
297304
}
298305

299306
@media (max-width: 768px) {
@@ -382,6 +389,9 @@ const tocHeadings = headings.filter((h) => h.depth === 2 || h.depth === 3);
382389
opacity: 0;
383390
pointer-events: none;
384391
transition: opacity var(--transition-normal);
392+
/* Performance optimizations for dynamic visibility */
393+
will-change: opacity;
394+
isolation: isolate;
385395
}
386396

387397
@media (max-width: 768px) {
@@ -493,6 +503,8 @@ const tocHeadings = headings.filter((h) => h.depth === 2 || h.depth === 3);
493503
border-left-color: var(--accent);
494504
color: var(--accent);
495505
font-weight: var(--font-weight-medium);
506+
/* Force GPU acceleration for active state */
507+
transform: translateZ(0);
496508
}
497509

498510
/* Dark mode styles */

website/src/components/Navigation.astro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,11 @@ function isActive(slug: string | undefined) {
342342
visibility: hidden;
343343
transform: translateY(20px);
344344
transition: var(--scroll-button-transition);
345+
346+
/* Performance optimizations for fixed positioning */
347+
will-change: transform, opacity, visibility;
348+
/* Create own stacking context to prevent containment issues */
349+
isolation: isolate;
345350
}
346351

347352
/* Show floating button when sidebar is hidden */

website/src/components/ScrollToTop.astro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@
8383
visibility: hidden;
8484
transform: var(--scroll-button-transform-hidden);
8585
transition: var(--scroll-button-transition);
86+
87+
/* Performance optimizations for fixed positioning */
88+
will-change: transform, opacity, visibility;
89+
/* Create own stacking context to prevent containment issues */
90+
isolation: isolate;
8691
}
8792

8893
.scroll-to-top.visible {

website/src/layouts/DocsLayout.astro

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,14 @@ const theme = themeCookie?.value === "dark" ? "dark" : "light";
562562
transition: background-color var(--transition-fast),
563563
color var(--transition-fast),
564564
font-weight var(--transition-fast) !important;
565+
/* Force repaint for active state changes */
566+
will-change: background-color, color;
567+
}
568+
569+
/* Ensure active state changes repaint immediately */
570+
.nav-link.active {
571+
/* Trigger immediate repaint for active state */
572+
transform: translateZ(0);
565573
}
566574

567575
/* Prevent view transition from interfering with nav link transitions */
@@ -573,6 +581,12 @@ const theme = themeCookie?.value === "dark" ? "dark" : "light";
573581
}
574582
}
575583

584+
/* Optimize sidebar for dynamic content changes */
585+
.sidebar {
586+
/* Allow paint updates for active link changes */
587+
contain: layout style;
588+
}
589+
576590
::view-transition-old(main) {
577591
animation: none;
578592
}
@@ -700,8 +714,8 @@ const theme = themeCookie?.value === "dark" ? "dark" : "light";
700714
min-height: 100vh;
701715
gap: var(--layout-docs-container-gap, var(--space-2xl));
702716
position: relative;
703-
/* Improve layout stability */
704-
contain: layout style paint;
717+
/* Improve layout stability - use style containment only to avoid blocking paint updates */
718+
contain: layout style;
705719
}
706720

707721
/* Only use 3-column layout on desktop where TOC is visible */

website/src/layouts/LandingLayout.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,8 @@ const theme = themeCookie?.value === "dark" ? "dark" : "light";
662662
.landing-container {
663663
min-height: 100vh;
664664
width: 100%;
665-
/* Improve layout stability */
666-
contain: layout style paint;
665+
/* Improve layout stability - avoid paint containment for dynamic content */
666+
contain: layout style;
667667
}
668668

669669
.landing-content {

0 commit comments

Comments
 (0)