'How to add custom checkbox css in antd tree without import antd css file?

antd v4.20.2

I am using antd tree component to show parent and child data in a tree structure. Without import 'antd/dist/antd.css' file the tree shows as per the below-attached image.

enter image description here

When import 'antd/dist/antd.css' file the checkbox shows properly as per the attached image below.

enter image description here

But the problem is that when importing antd CSS file then also changes entire project styles but I want only the checkbox in the tree component.

How to add custom checkbox in antd tree component.

This is the code for the tree component.

<Tree
      checkable
      onExpand={onExpand}
      expandedKeys={expandedKeys}
      autoExpandParent={autoExpandParent}
      onCheck={onCheck}
      checkedKeys={checkedKeys}
      treeData={reasonGroup}
      selectedKeys={selectedKeys}
      fieldNames={{ title: "name", key: "id", children: "subReason" }}/>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source