【问题标题】:Change ant design collapse content and header text color更改 ant design 折叠内容和页眉文本颜色
【发布时间】:2021-11-03 15:29:56
【问题描述】:

如何更改标题的文本颜色以及ant-collapse-content 的内容。我正在使用StyledAntCollapse 设置样式,这是我的代码:

const StyledCollapse = styled(AntCollapse)`
  &&& {
    border: none;
    border-radius: 0px;
    box-shadow: none;  
    background: #0e0304;
  }
  .ant-collapse-content {
    fontSize: 25px;
    color: #fff;
  }
  .ant-collapse-header {
    fontSize: 25px;
    color: #fff;
  }
`;

我尝试将 :global 用于 contentheader,但效果不佳。

【问题讨论】:

    标签: reactjs antd


    【解决方案1】:

    尝试:

    const StyledCollapse = styled(AntCollapse)`
      &&& {
        border: none;
        border-radius: 0px;
        box-shadow: none;  
        background: #0e0304;
      }
      &.ant-collapse-content {
        fontSize: 25px;
        color: #fff;
      }
      &.ant-collapse-header {
        fontSize: 25px;
        color: #fff;
      }
    `;
    

    【讨论】:

    • 我向上移动了ant-collapse-content,现在问题已经解决了。不过感谢您的帮助! :D
    猜你喜欢
    • 2021-02-25
    • 2021-12-13
    • 2020-01-20
    • 2019-04-26
    • 2021-11-23
    • 1970-01-01
    • 1970-01-01
    • 2021-09-17
    • 1970-01-01
    相关资源
    最近更新 更多