# All files / extensions themeGet.js

0% Statements 0/10
0% Branches 0/8
0% Functions 0/3
0% Lines 0/5

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

     import { cssvarKey } from 'theme/cssvars';
    import irisTheme from 'theme/irisTheme';
    import { get } from 'lodash';

    /**
     * @deprecated Provided only to support the legacy theme system.
     * Converts a JSON key (spacing.medium) into a cssvar (var(--spacing-medium)).
     */
    const themeGet = k => props =>
      window.CSS && window.CSS.supports('--css-var', 0)
        ? `var(${cssvarKey(k)})`
        : get(irisTheme, k);

    export default themeGet;