use transition on ::-webkit-scrollbar?

后端 未结 5 692
野的像风
野的像风 2021-02-02 09:06

is it possible to use transitions on webkit scrollbars? I tried:

div#main::-webkit-scrollbar-thumb {
    background: rgba(255,204,102,0.25);
    -webkit-transiti         


        
5条回答
  •  温柔的废话
    2021-02-02 09:42

    There is a fair amount you can do to style the scroll bar:

    ::-webkit-scrollbar {
        width: 18px;
        height: 20px;
    }
    ::-webkit-scrollbar-thumb {
        height: 6px;
        border: 4px solid rgba(0, 0, 0, 0);
        background-clip: padding-box;
        -webkit-border-radius: 7px;
        background-color: rgba(0, 0, 0, 0.70);
        -webkit-box-shadow: inset -1px -1px 0px rgba(0, 0, 0, 0.05), inset 1px 1px 0px rgba(0, 0, 0, 0.05);
    }
    ::-webkit-scrollbar-button{
        width: 0;
        height: 0;
        display: none;
    }
    ::-webkit-scrollbar-corner {
        background-color: transparent;
    }
    

    However sadly I believe you cannot do what you are asking.

    JSFiddle

提交回复
热议问题