How to use the @microsoft/fast-web-utilities.canUseFocusVisible function in @microsoft/fast-web-utilities

To help you get started, we’ve selected a few @microsoft/fast-web-utilities 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 microsoft / fast-dna / packages / fast-jss-utilities / src / apply-focus-visible.ts View on Github external
selector = "";
        styles = a;
    } else if (typeof a === "string") {
        selector = a;
        styles = b;
    } else {
        return {};
    }

    return Object.assign(
        {
            "&:focus": {
                outline: "none",
            },
        },
        canUseFocusVisible()
            ? {
                  [applyFocusVisibleSelector(selector)]: styles,
              }
            : {
                  [applyFocusVisiblePolyfillSelector(selector)]: styles,
              }
    );
}