1

I want to change color of Icon which make by function **createFromIconfontCN** of ant-design icons tool, but I can't find the way to customize it.
Is there any way to change its color ?

Here is my code:

import { createFromIconfontCN } from '@ant-design/icons';

const IconFont = createFromIconfontCN({
  scriptUrl: '//at.alicdn.com/t/font_1920998_qwtyc6g5q7f.js',
});

ReactDOM.render(
  <div>
    <IconFont type="iconright"></IconFont>
  </div>,
  mountNode,
);

You can check it out here:
https://ant.design/components/icon/
Section: **Use iconfont.cn**

Thank you!

Tho Bui Ngoc
  • 763
  • 1
  • 11
  • 36

1 Answers1

2

If you include a style property with the color you want, it changes the color.

<IconFont type="iconright" style={{ color: "green" }} />

check this sandbox

Apostolos
  • 10,033
  • 5
  • 24
  • 39