feat: use system theme by default (#932)
* feat: use system theme by default * Move logic to default prop Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
This commit is contained in:
parent
9fbf317046
commit
4285965fab
1 changed files with 5 additions and 1 deletions
|
@ -102,6 +102,10 @@ export interface TldrawProps extends TDCallbacks {
|
|||
disableAssets?: boolean
|
||||
}
|
||||
|
||||
const isSystemDarkMode = window.matchMedia
|
||||
? window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||
: false
|
||||
|
||||
export function Tldraw({
|
||||
id,
|
||||
document,
|
||||
|
@ -116,7 +120,7 @@ export function Tldraw({
|
|||
showUI = true,
|
||||
readOnly = false,
|
||||
disableAssets = false,
|
||||
darkMode = false,
|
||||
darkMode = isSystemDarkMode,
|
||||
onMount,
|
||||
onChange,
|
||||
onChangePresence,
|
||||
|
|
Loading…
Reference in a new issue