Skip to content

Commit

Permalink
feat: Add a font icon classname to v9 font icons
Browse files Browse the repository at this point in the history
  • Loading branch information
tomi-msft committed Jul 29, 2024
1 parent 184f8fd commit cf188e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/react-icons/src/utils/constants.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const iconFilledClassName = "fui-Icon-filled";
export const iconRegularClassName = "fui-Icon-regular";
export const iconLightClassName = "fui-Icon-light";
export const iconLightClassName = "fui-Icon-light";
export const fontIconClassName = "fui-Icon-font"
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import { FluentIconsProps } from '../FluentIconsProps.types';
import { makeStyles, makeStaticStyles, mergeClasses } from "@griffel/react";
import { useIconState } from '../useIconState';
import { fontIconClassName } from '../constants';

import fontFilledTtf from './FluentSystemIcons-Filled.ttf';
import fontFilledWoff from './FluentSystemIcons-Filled.woff';
Expand Down Expand Up @@ -96,7 +97,7 @@ export function createFluentFontIcon(displayName: string, codepoint: string, fon
const Component: React.FC<FluentIconsProps<React.HTMLAttributes<HTMLElement>, HTMLElement>> & { codepoint: string} = (props) => {
useStaticStyles();
const styles = useRootStyles();
const className = mergeClasses(styles.root, styles[font], props.className);
const className = mergeClasses(styles.root, styles[font], fontIconClassName, props.className);
const state = useIconState<React.HTMLAttributes<HTMLElement>, HTMLElement>({...props, className}, { flipInRtl: options?.flipInRtl });


Expand Down

0 comments on commit cf188e9

Please sign in to comment.