UNPKG

720 BJavaScriptView Raw
1import { mergeStyles } from '@uifabric/merge-styles';
2import { getIcon } from './icons';
3var defaultIconStyles = {
4 display: 'inline-block',
5};
6/**
7 * Gets an icon classname. You should be able to add this classname to an I tag with no
8 * additional classnames, and render the icon.
9 *
10 * @public
11 */
12export function getIconClassName(name) {
13 var className = '';
14 var icon = getIcon(name);
15 if (icon) {
16 className = mergeStyles(icon.subset.className, defaultIconStyles, {
17 selectors: {
18 '::before': {
19 content: "\"" + icon.code + "\"",
20 },
21 },
22 });
23 }
24 return className;
25}
26//# sourceMappingURL=getIconClassName.js.map
\No newline at end of file