From 528e7334465ada682834c58352f6d711dcffcabe Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Fri, 26 Mar 2021 13:16:03 +0800 Subject: [PATCH] fix: disable automatic theme detection --- src/docup.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/docup.ts b/src/docup.ts index 4faea9a..3d3c1fd 100644 --- a/src/docup.ts +++ b/src/docup.ts @@ -21,6 +21,12 @@ export interface Options { props?: any font?: string base?: string + /** + * @alpha + * Use a custom theme + * + * the `dark` theme is now very experimental, expected many bugs + */ theme?: 'default' | 'dark' } @@ -33,18 +39,12 @@ export class Docup { options: InstanceOptions constructor(options: Options = {}) { - const matchedDarkTheme = - typeof window !== 'undefined' && - window.matchMedia && - window.matchMedia('(prefers-color-scheme: dark)').matches - this.options = { title: options.title || document.title || 'Docup', indexFile: 'README.md', root: '', base: '/', highlight: true, - theme: matchedDarkTheme ? 'dark' : 'default', ...options, } }