UNPKG

@equinor/eds-utils

Version:

Utility functions and hooks for the Equinor Design System

15 lines (12 loc) 388 B
import { useCallback } from 'react'; import mergeDeepRight from '../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/mergeDeepRight.mjs'; const useToken = (options, token) => useCallback(() => { const { density } = options; if (density === 'compact') { return mergeDeepRight(token, token.modes.compact); } return token; }, [options, token]); export { useToken };