Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The best solution is to make separate overloads for each number of shadows. Less handles the proper overload resolution:</p> <pre><code>.box-shadow(@shadow1) { -webkit-box-shadow: @shadow1; -moz-box-shadow: @shadow1; box-shadow: @shadow1; } .box-shadow(@shadow1, @shadow2) { -webkit-box-shadow: @shadow1, @shadow2; -moz-box-shadow: @shadow1, @shadow2; box-shadow: @shadow1, @shadow2; } .box-shadow(@shadow1, @shadow2, @shadow3) { -webkit-box-shadow: @shadow1, @shadow2, @shadow3; -moz-box-shadow: @shadow1, @shadow2, @shadow3; box-shadow: @shadow1, @shadow2, @shadow3; } .box-shadow(@shadow1, @shadow2, @shadow3, @shadow4) { -webkit-box-shadow: @shadow1, @shadow2, @shadow3, @shadow4; -moz-box-shadow: @shadow1, @shadow2, @shadow3, @shadow4; box-shadow: @shadow1, @shadow2, @shadow3, @shadow4; } .box-shadow(@shadow1, @shadow2, @shadow3, @shadow4, @shadow5) { -webkit-box-shadow: @shadow1, @shadow2, @shadow3, @shadow4, @shadow5; -moz-box-shadow: @shadow1, @shadow2, @shadow3, @shadow4, @shadow5; box-shadow: @shadow1, @shadow2, @shadow3, @shadow4, @shadow5; } </code></pre> <p>EDIT:</p> <p>Ok, I'm still learning about LESS, but it appears that will actually mixin <strong>ALL</strong> of the overloads in certain situations, instead of the one with the most applicable parameter list, so you may get varying results. I've since revised my mixins so that they're named box-shadow-2 or box-shadow-3, to match the expected number of parameters. I'll revise my answer once I figure out what's going on / have a better solution.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload