docs: Reduce layout shift when navigating between pages (#43758)

This is still not perfect, but it reduces the shift that happens when
navigating between pages that have and don't have the table of contents.
It also tries to reduce the theme flicker that happens by moving its
loading to an earlier moment.

Release Notes:

- N/A
This commit is contained in:
Danilo Leal
2025-11-28 18:36:47 -03:00
committed by GitHub
parent d4c0b87fb2
commit e8a3368226
3 changed files with 62 additions and 37 deletions
+12
View File
@@ -60,6 +60,18 @@
color: var(--full-contrast);
}
.toc-container {
visibility: hidden;
}
.toc-container.has-toc {
visibility: visible;
}
.toc-container.no-toc {
display: none;
}
@media only screen and (max-width: 1020px) {
.toc-container {
display: none;