WEB-qq-635678224 / JS-Note

前端小技巧, 日常工作遇到的问题(issues)
12 stars 0 forks source link

滚动条美化 支持谷歌 #56

Open Lee981265 opened 3 years ago

Lee981265 commented 3 years ago
  <div
       class="textArea"
       @mouseover="OverY = 'overlay'"
       @mouseout="OverY = 'hidden'"
       :style="`overflow-y:${OverY}`"
    >
   </div>
Lee981265 commented 3 years ago

CSS滚动条选择器(伪元素选择器)

      &::-webkit-scrollbar {
        width: 6px;
        background-color: #fff;
      }
      &::-webkit-scrollbar-thumb {
        border-radius: 4px;
        box-shadow: inset 0 0 6px rgba(2, 26, 67, 0.1);
      }
      &::-webkit-scrollbar-track {
        border-radius: 4px;
        background-color: #fff;
      }
      &::-webkit-scrollbar-track-piece {
        background-color: #eff2fb;
        border-radius: 6px;
      }