0

im new to less and im trying a little bit around, ive found a mixin code snippet which should work but it doesnt. Just if i take the variables on top of the reset.less document it works. So i guess my Joomla Less compiler couldn't compile it right. But as im new to less i dont now if the code is appropriate. I was trying following code:

    .inner-shadow (@x: 0, @y: 1px, @blur: 2px, @spread: 0, @alpha: 0.25) {
    -webkit-box-shadow: inset @x @y @blur @spread rgba(0, 0, 0, @alpha);
    -moz-box-shadow:    inset @x @y @blur @spread rgba(0, 0, 0, @alpha);
    box-shadow:         inset @x @y @blur @spread rgba(0, 0, 0, @alpha);
    }

After i written it that way it worked:

    @x: 0; @y: 1px; @blur: 2px; @spread: 0; @alpha: 0.25;
    .inner-shadow{
    -webkit-box-shadow: inset @x @y @blur @spread rgba(0, 0, 0, @alpha);
    -moz-box-shadow:    inset @x @y @blur @spread rgba(0, 0, 0, @alpha);
    box-shadow:         inset @x @y @blur @spread rgba(0, 0, 0, @alpha);
    }
  • 1
    The first method is a parameterized mixin (whereas the second isn't). Parameterized mixins must be called from inside another selector block for it to be output in CSS. Is your code doing that? I cannot see anything wrong with the mixin code. If called in the right way, it should produce output. – Harry Sep 06 '14 at 11:09
  • @Harry its a pity but it isnt working in my case. It doesn't produce any output – jasongrimes Sep 10 '14 at 10:11
  • Can I see the full code and how it is called? Could you post it in CodePen or CSSDeck or JSBin (all of them support Less)? – Harry Sep 10 '14 at 10:37
  • Yes of course just a minute sorry for the lated answer How i call it in global.less http://pastebin.com/TVDpAUgh How the less file looks(reset.less): http://pastebin.com/su7NFfQp – jasongrimes Sep 10 '14 at 11:06
  • The code seems to be of the second version (which as you had indicated worked fine). Please post the code that you are trying when using the first method. – Harry Sep 10 '14 at 11:37

0 Answers0