From: Louis-Maxime Piton Date: Tue, 23 Jul 2024 07:18:00 +0000 (+0200) Subject: Merge branch 'main' into main-lmp-contextual-theme-switcher X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0816e952ead4fc395253489e9942182c92f28c47;p=thirdparty%2Fbootstrap.git Merge branch 'main' into main-lmp-contextual-theme-switcher --- 0816e952ead4fc395253489e9942182c92f28c47 diff --cc site/layouts/shortcodes/example.html index ffb3400b56,5b398e6814..fb9ba000bf --- a/site/layouts/shortcodes/example.html +++ b/site/layouts/shortcodes/example.html @@@ -29,36 -29,8 +29,36 @@@ {{- if eq $show_markup true -}} {{- if eq $show_preview true -}}
- {{- $lang -}} + {{ $lang }}
+ diff --cc site/static/docs/5.3/assets/js/color-modes.js index 31ae959e85,8a0dabf181..be4b178ebf --- a/site/static/docs/5.3/assets/js/color-modes.js +++ b/site/static/docs/5.3/assets/js/color-modes.js @@@ -19,11 -19,11 +19,11 @@@ return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' } - const setTheme = theme => { + const setTheme = (theme, element = document.documentElement) => { - if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) { - element.setAttribute('data-bs-theme', 'dark') + if (theme === 'auto') { - document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) ++ element.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) } else { - document.documentElement.setAttribute('data-bs-theme', theme) + element.setAttribute('data-bs-theme', theme) } }