docs: Update api reference (#1410)

This commit is contained in:
Shahed Nasser
2022-05-24 14:22:42 +03:00
committed by GitHub
parent 5e0e5b90fc
commit 08c63097f9
7 changed files with 6338 additions and 3001 deletions

View File

@@ -6,11 +6,16 @@ import React from 'react'
import { ThemeToggler } from 'gatsby-plugin-dark-mode'
import { useColorMode } from 'theme-ui'
const isBrowser = typeof window !== "undefined"
export default function ColorModeToggler () {
const [, setColorMode] = useColorMode()
function checkLocalStorage (currentTheme, toggleTheme) {
//check that theme local storage values are set correctly
if (!isBrowser) {
return currentTheme;
}
let themeUiColorMode = window.localStorage.getItem('theme-ui-color-mode');
let theme = window.localStorage.getItem('theme')
if (!themeUiColorMode) {