antd table 滚动条样式调整(部分)

prefixCls为项目做的样式隔离 项目名前缀

       .${prefixCls}-table-body {
            /**important 为解决乾坤框架内样式优先度被冲掉问题 */
            scrollbar-width: auto;
            scrollbar-color: auto;

            &::-webkit-scrollbar {
              width: 10px;
              height: 10px;
            }

            &::-webkit-scrollbar-track {
              background-color: transparent !important;
            }

            &::-webkit-scrollbar-thumb {
              border: 2px solid transparent !important;
              background-clip: padding-box !important;
              border-radius: 8px;
            }

            &::-webkit-scrollbar-thumb:hover {
              border-width: 0 !important;
            }
          }
image.png

移入加粗版

// 滚动条-移入加粗版
.scrollbar {
  overflow: auto;

  &:hover {
    &::-webkit-scrollbar-thumb:hover {
      border: 0;
      border-radius: 6px;
    }
  }

  &::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  &::-webkit-scrollbar-track {
    background-color: transparent;
  }

  &::-webkit-scrollbar-thumb {
    width: 8px;
    height: 8px;
    transition: 0.8s;
    border: 2px solid transparent;
    border-radius: 8px;
    background-clip: padding-box;
    background-color: #c9cdd4;
  }
}

移入显示版

  // 滚动条-移入显示版
  .scrollbar-transparent {
    @extend .scrollbar;
    overflow-y: scroll;

    &:hover {
      &::-webkit-scrollbar-thumb {
        border: 2px solid transparent;
        background-clip: padding-box;
        background-color: #c9cdd4;
      }

      &::-webkit-scrollbar-thumb:hover {
        border: 1px solid transparent;
      }
    }

    &::-webkit-scrollbar-thumb {
      background-color: transparent;
    }
  }

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容