Set the thickness of ant design icons in CSS

Viewed 1364

Attached Image of icon to set the thickness

I have tried to set the thickness of the circle using stroke and stroke-width in css but none of them worked. The icon is imported from the antdesign . Anybody can help with this? Much appreciated. Thanks

Currently my code looks like this(React)

<PlusCircleOutlined
    style={{
         fontSize: "50px",
         color: "#408021",
         storke: "#408021",
         strokeWidth: "2px",
        }}
 />
enter code here
3 Answers

You have a typo error "storke", should be "stroke", but this is not the problem. To make the lines more thickness you will need to use the stroke property equal white or equal to the background color to erase part of the filled area:

  <PlusCircleOutlined  style={{
        fontSize: "50px",
         color: "#408021",
         strokeWidth: "30", // --> higher value === more thickness the filled area
         stroke: "white" 
  }}/>

Looks like you have a typo: storke: "#408021". Update that to stroke and it should work.

I always prefer to keep my styles in the css, so I did:

-In my jsx:

<PlusCircleOutlined className="icon-bold" />

-And in my styles:

.icon-bold {
  stroke-width: 25;
  stroke: black;
  color: black;
}
Related