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

后端 未结 7 1599
情深已故
情深已故 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:02

    You could use a CSS pre-processor to do your skinning. With Sass you can do something similar to this:

    _theme1.scss:

    $theme-primary-color: #a00;
    $theme-secondary-color: #d00;
    // etc.
    

    _theme2.scss:

    $theme-primary-color: #666;
    $theme-secondary-color: #ccc;
    // etc.
    

    styles.scss:

    // import whichever theme you want to use
    @import 'theme2';
    
    -webkit-box-shadow: inset 0px 0px 2px $theme-primary-color;
    -moz-box-shadow: inset 0px 0px 2px $theme-primary-color;
    

    If it's not site wide theming but class based theming you need, then you can do this: http://codepen.io/jjenzz/pen/EaAzo

提交回复
热议问题