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? -

html - Unable to style the color of bullets in a list -

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