How to use the reakit-system/useToken.useToken function in reakit-system

To help you get started, we’ve selected a few reakit-system examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github reakit / reakit / packages / reakit-system-palette / src / utils / contrast.ts View on Github external
export function useContrast(color?: string) {
  React.useDebugValue(color);
  const palette = useToken("palette");
  return React.useMemo(() => contrast(color)(palette), [color, palette]);
}
github reakit / reakit / packages / reakit-system-palette / src / utils / palette.ts View on Github external
export function usePalette(name?: string) {
  React.useDebugValue(name);
  const palette = useToken("palette");
  return getPalette(palette, name);
}