From da2dae0146754a03bfb9f96893d5b74f2463e799 Mon Sep 17 00:00:00 2001 From: Richard Iannone Date: Fri, 23 Oct 2026 16:17:32 -0400 Subject: [PATCH 1/4] Delay page reveal until theme setup completes --- great_docs/assets/theme-init.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/great_docs/assets/theme-init.js b/great_docs/assets/theme-init.js index ea6e7888..02ef36a5 100644 --- a/great_docs/assets/theme-init.js +++ b/great_docs/assets/theme-init.js @@ -8,9 +8,6 @@ var theme = stored || (darkModeDisabled ? 'light' : (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')); var html = document.documentElement; - // Hide body until theme is fully applied to prevent flash - html.classList.add('theme-loading'); - if (theme === 'dark') { html.classList.add('quarto-dark'); html.setAttribute('data-bs-theme', 'dark'); @@ -61,13 +58,18 @@ } } - // Reveal page once DOM is ready and styles are applied + // Reveal the page once the DOM is parsed and after-body scripts have run. + // The page is hidden by an inline + $if(quarto-version)$ $else$ From d4c82a23326d9ea02df4460cfc3550a62c305331 Mon Sep 17 00:00:00 2001 From: Richard Iannone Date: Fri, 23 Oct 2026 16:18:09 -0400 Subject: [PATCH 4/4] Exclude page-reveal styles from metadata comparison --- tests/test_metadata_partial.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/test_metadata_partial.py b/tests/test_metadata_partial.py index 7489c192..7a79ef8e 100644 --- a/tests/test_metadata_partial.py +++ b/tests/test_metadata_partial.py @@ -17,6 +17,8 @@ HEAD_TAGS_LOOP = ["$for(gd-head-tags)$", "$gd-head-tags$", "$endfor$"] # Removed as one block, since `$endif$` also closes Quarto's own conditionals. ROBOTS_LINES = ["$if(robots)$", '', "$endif$"] +# Hide the page until theme-init.js reveals it (with a no-JS fallback). +PAGE_REVEAL_PREFIXES = ("