diff --git a/content/_layouts/frame.html.haml b/content/_layouts/frame.html.haml index 6afbd6a5d6c3..e02cc51130e6 100644 --- a/content/_layouts/frame.html.haml +++ b/content/_layouts/frame.html.haml @@ -125,4 +125,10 @@ $body.on("keydown", function(){ $body.removeClass("no-outline"); }) + const updateTheme = () => { + const dark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; + document.documentElement.dataset.theme = dark ? "dark" : ""; + } + updateTheme(); + window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', updateTheme); }) diff --git a/content/css/jenkins.css b/content/css/jenkins.css index 4ffdf657d30b..d463383d2008 100644 --- a/content/css/jenkins.css +++ b/content/css/jenkins.css @@ -1546,8 +1546,7 @@ ion-icon.report { max-height: 128px; } -/* Algolia searchbox "No results" text */ -.DocSearch-NoResults p.DocSearch-Title { - color: rgba(0, 0, 0, 0.528); +[data-theme="dark"] .DocSearch-NoResults p.DocSearch-Title { + color: rgba(255, 255, 255, 0.634); font-weight: bold; -} \ No newline at end of file +}