Xiaobai asked a question about style reset.

clipboard.png

in Ant Desig, I want to change the tabs component that can be added and deleted dynamically, and I want to reset the style of the card, but I haven"t achieved the result for a long time. It doesn"t work. Can a style like this be reset? Is there any way? Thank you!

Feb.10,2022

if you want to modify the style, you can find the corresponding class name to overwrite it. If the weight is not enough, add ! important


add! important should be careful, it will bring great inconvenience to later maintenance. It is recommended to increase the weight. You can add an ID, to the parent and then the selector starts from ID to write


component libraries generally provide theme adaptation mechanism. It is not recommended to use the class name or! important to do it directly, and the maintainability decreases greatly over a long period of time.


increase the weight of the current selector on the current page to overwrite the original style


:global {
    .ant-card-bordered {
      border-top: 2px solid red;
    }
  }

something like this

Menu