css3 - LESS CSS parametric mixin default null value does not work -


i have lesscss mixin box-shadow :

.box-shadow(@x, @y, @blur, @color, @addit: ''){     -webkit-box-shadow: @x @y @blur @color @addit;     -moz-box-shadow: @x @y @blur @color @addit;     box-shadow: @x @y @blur @color @addit; } 

as seen, there parameter @addit set '' default.

it's work fine when give @addit value : .box-shadow(0, 0, 2px, #1361aa, inset), why if parameter @addit not filled, doesn't work? , how fix it?

help, advance.

escape empty string default

you need set default value ~'' escaped string.

less

.box-shadow(@x, @y, @blur, @color, @addit: ~''){     -webkit-box-shadow: @x @y @blur @color @addit;     -moz-box-shadow: @x @y @blur @color @addit;     box-shadow: @x @y @blur @color @addit; }  .test{    .box-shadow(0, 0, 2px, #1361aa) } 

css

.test {   -webkit-box-shadow: 0 0 2px #1361aa ;   -moz-box-shadow: 0 0 2px #1361aa ;   box-shadow: 0 0 2px #1361aa ; } 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -