diff --git a/docs/_includes/base.njk b/docs/_includes/base.njk
index b21d537df..b0a97838c 100644
--- a/docs/_includes/base.njk
+++ b/docs/_includes/base.njk
@@ -83,8 +83,6 @@
-
-
{% block header %}
{% include 'breadcrumbs.njk' %}
{{ title }}
diff --git a/docs/_includes/head.njk b/docs/_includes/head.njk
index 1121fd1d8..ffaf57bcc 100644
--- a/docs/_includes/head.njk
+++ b/docs/_includes/head.njk
@@ -30,18 +30,18 @@
{# Preset Theme #}
-
+
{% if not forceTheme %}
diff --git a/docs/assets/scripts/preset-theme-picker.js b/docs/assets/scripts/preset-theme-picker.js
index b51cfeb9d..5a4c6e377 100644
--- a/docs/assets/scripts/preset-theme-picker.js
+++ b/docs/assets/scripts/preset-theme-picker.js
@@ -5,7 +5,7 @@ const presetTheme = new ThemeAspect({
key: 'presetTheme',
picker: 'wa-select.preset-theme-selector',
- applyChange() {
+ applyChange(options = {}) {
const oldStylesheets = [...document.querySelectorAll('#theme-stylesheet')];
const oldStylesheet = oldStylesheets.pop();
@@ -38,7 +38,7 @@ const presetTheme = new ThemeAspect({
oldStylesheet.remove();
},
- { behavior: 'smooth' },
+ { behavior: 'smooth', ...options },
);
},
{ once: true },
@@ -61,4 +61,8 @@ function updateSelectionBeforeTurboLoad(e) {
document.addEventListener(eventName, updateSelectionBeforeTurboLoad);
});
+window.addEventListener('turbo:render', e => {
+ presetTheme.applyChange({ behavior: 'instant' });
+});
+
window.presetTheme = presetTheme;