import { useLayoutEffect } from 'react' ; export function useCSSVariable ( name , value , element = document . documentElement ) { useLayoutEffect ( ( ) => { element . style . setProperty ( name , value ) ; } , [ name , value , element ] ) ; }