Skip to content

Commit

Permalink
fix: disable automatic theme detection
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Mar 26, 2021
1 parent 36d99fc commit 528e733
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/docup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand All @@ -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,
}
}
Expand Down

1 comment on commit 528e733

@vercel
Copy link

@vercel vercel bot commented on 528e733 Mar 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.