1 | import { mergeStyles } from '@uifabric/merge-styles';
|
2 | import { getIcon } from './icons';
|
3 | var 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 | */
|
12 | export 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 |