search

Home  >  Q&A  >  body text

Fix warning "Standard property 'box-shadow' is also defined for compatibility"

I use the scrolling library and VSCode shows the following warning:

Also defines the standard property "box-shadow" for compatibility

How to fix it or at least ignore the warning on VSCode?

.scrollbar-black::-webkit-scrollbar-thumb {
    border-radius: 10px;
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
    background-color: #000;
}

P粉412533525P粉412533525405 days ago680

reply all(2)I'll reply

  • P粉513316221

    P粉5133162212023-10-18 16:04:26

    For me, I ran into a problem where -webkit-background-clip: text; Background clipping: The hidden was-webkit-background-text had to match (box-shadow) and changed it to background clipping, then it fixed my error.

    reply
    0
  • P粉517090748

    P粉5170907482023-10-18 11:58:24

    This means that in addition to the vendor-prefixed version (-webkit-box-shadow), you should also add the standard style rules (box-shadow)

    .scrollbar-black::-webkit-scrollbar-thumb {
        border-radius: 10px;
        -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
                box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1); // <- Add this to fix.    
        background-color: #000;
    }
    

    reply
    0
  • Cancelreply