* use platform features for date picker * handle color modes properly * colorScheme native in body only not on html
13 lines
370 B
TypeScript
13 lines
370 B
TypeScript
import { useColorModeValue } from "@chakra-ui/system";
|
|
import { useEffect } from "react";
|
|
|
|
export function useNativeColorMode() {
|
|
const activeColorMode = useColorModeValue("light", "dark");
|
|
useEffect(() => {
|
|
document
|
|
.getElementById("tw-body-root")
|
|
?.style.setProperty("color-scheme", activeColorMode);
|
|
}, [activeColorMode]);
|
|
return undefined;
|
|
}
|