How to use antd icons in CSS pseudo-elements

Viewed 388

I'm currently getting an icon like this:

import { Icon } from "antd";
...

// inside react component:
<div className="someclass">
  <Icon type="thunderbolt" /> 
</div>

What I really want to do is this, with CSS:

div.someclass::before {
  content: "\E6EA"; // pretend this is the correct thunderbolt icon code
}

Now I think I'm reading that antd doesn't use a font for icons, but direct SVG. Is that correct? Does that mean that inserting icons with CSS is not possible with antd?

1 Answers

No, you can't use CSS pseudo-elements now, they replaced for SVG (since version 3.9.0). You can read it here and the pr discussion why here.

Related