如何更改ant-design Tabs默认边框颜色

How to change ant-design Tabs default border color

我无法更改antd的默认边框颜色Tabs

带默认边框的选项卡:

我要的是这个:

不知何故,我能够实现这一点,但它没有响应,需要更多时间。 弄乱了手机屏幕等等

...
/* rest of css in codesandbox, https://codesandbox.io/s/so-change-antd-tabs-default-border-color-40gmb?file=/index.css */
...

  .ant-tabs-content-holder {
    border-width: 1px;
    border-color: grey;
    border-style: solid;
    padding: 1rem;
    background: white;
    position: relative;
  }

 .ant-tabs-content-holder:after {
    padding: 0;
    margin: 0;
    display: block;
    content: '';
    height: 1.1px;
    position: absolute;
    top: -1px;

    left:  0%;
    width: 24.8%;
    background-color: white;
  }

这是它在移动屏幕上的样子。我想我可以为不同的屏幕宽度使用许多断点并更改 .ant-tabs-content-holder:afterleftwidth 的百分比,但这很乏味。

如何以更简单的方式实现这一点?任何的想法?是否有我可以与 webpack 或 less 一起使用的选项卡边框的蚂蚁设计 vars? antd docs 有样式道具吗?我会感谢你的帮助。

签出代码:codesandbox

刚刚尝试覆盖现有边界(使用相同的选择器)似乎可以完成工作。

https://codesandbox.io/s/so-change-antd-tabs-default-border-color-forked-tkg3h?file=/index.css

.ant-tabs-card > .ant-tabs-nav .ant-tabs-tab { /* For tabs border */
  border-color: black;
}

.ant-tabs-top > .ant-tabs-nav::before { /* For the line to the right and close to the tabs */
  border-color: black;
}

.ant-tabs > .ant-tabs-nav { /* So that there is no gap between the content and tabs */
  margin-bottom: 0;
}

.ant-tabs-content-holder {
  padding: 15px;
  border: 1px solid black; /* Border for the content part */
  border-top: transparent; /* Remove the top border so that there is no overlap*/
}

你只需要覆盖上面的4个类来实现你的布局:

CodeSandbox Demo

输出: