pass a list to a mixin as a single argument with SASS

后端 未结 6 1037
悲哀的现实
悲哀的现实 2021-01-30 06:35

I like to make mixins with SASS that help me make good cross-browser compatibility. I want to make a mixin that looks like this:

@mixin box-shadow($value) {
             


        
6条回答
  •  孤独总比滥情好
    2021-01-30 07:26

    This doesn't compile:

    +box-shadow(inset 0 1px 0 #FFD265, 0 0 0 1px #912E01, 0 0 0 7px rgba(0, 0, 0, .1), 0 1px 4px rgba(0, 0, 0, .6))
    

    this compiles:

    +box-shadow((inset 0 1px 0 #FFD265, 0 0 0 1px #912E01, 0 0 0 7px rgba(0, 0, 0, .1), 0 1px 4px rgba(0, 0, 0, .6)))
    

    That is, add a parenthesis around the comma-separated list of shadows and it should work:

    +box-shadow( (myshadow1, myshadow2, ...) )
    

提交回复
热议问题