From 423036fda253d0c890a4cc1bbadc2e0ba6238979 Mon Sep 17 00:00:00 2001 From: GwynBleidD Date: Sun, 2 May 2021 15:09:51 +0200 Subject: [PATCH] Added support for prefers-color-scheme in docs Now, instead of always defaulting to light theme, documentation, docs will default to the color scheme based by the user preference (reported by web browser as a `prefers-color-scheme` media query). It is still possible for user to change the theme by using the switch next to the search box. His preference will be remembered. --- docs/docusaurus.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index ab7ec12d..385e3f56 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -10,6 +10,9 @@ module.exports = { projectName: "zmk", // Usually your repo name. plugins: [path.resolve(__dirname, "src/docusaurus-tree-sitter-plugin")], themeConfig: { + colorMode: { + respectPrefersColorScheme: true, + }, googleAnalytics: { trackingID: "UA-145201102-2", anonymizeIP: true,