Is there a 'box-shadow-color' property?

后端 未结 7 1585
情深已故
情深已故 2020-12-04 10:31

I have the following CSS:

box-shadow: inset 0px 0px 2px #a00;

Now I am trying to extract that color to make the page colors \'skinnable\'.

相关标签:
7条回答
  • 2020-12-04 11:21

    You can do this with CSS Variable

    .box-shadow {
        --box-shadow-color: #000; /* Declaring the variable */
        width: 30px;                
        height: 30px;
        box-shadow: 1px 1px 25px var(--box-shadow-color); /* Calling the variable */
    
    }
    
    .box-shadow:hover  {
        --box-shadow-color: #ff0000; /* Changing the value of the variable */
    }
    
    0 讨论(0)
提交回复
热议问题