I am building a mixin for SCSS i would like to know it it is possible to add a aditional value, depending on a argument. This is what i have tried. Everything works, but the @if condition:
@mixin fontFace( $fontName, $path: "", $weight: normal, $style: none, $fileName: $fontName, $svg:0 ) {
@font-face {
font-family: $fontName;
src: url("#{$path}#{$fileName}.eot");
src: url("#{$path}#{$fileName}.eot?iefix") format("eot"),
url("#{$path}#{$fileName}.woff") format("woff"),
url("#{$path}#{$fileName}.ttf") format("truetype")
@if $svg != 0 {
, url("#{$path}#{$fileName}.svg##{$fileName}") format("svg");
}else{
;
}
font-weight: $weight;
font-style: $style;
}
}
How about the following: