0

It seems by the conventions of the other mixing I have created and seen that this should work but there is two problems with it that I can not seem to find the solution for .

  • The default path if not Quoted throws an error during compilation
  • The url($path) is not evaluating the $path variable
@mixin backgroundCover($path:"./Media/Images/background.png"){
background-image:url( $path );
background-repeat:no-repeat;
background-size:cover;
}

What is the proper way to write this function

==================== Worth noting that this issue came up again today

 @mixin keyframes( $animationName )
        {
        @-webkit-keyframes #{animationName} {
            @content;
        }
        @-moz-keyframes #{animationName} {
            @content;
        }
        @-o-keyframes #{animationName} {
            @content;
        }
        @keyframes #{animationName} {
            @content;
        }
    }

originally #{animationName} was $animationName and winging errors all over the place

Tegra Detra
  • 24,551
  • 17
  • 53
  • 78
  • Why is quoting the path a problem? I cannot reproduce your second point (path *is* evaluated). – cimmanon Mar 17 '14 at 18:12
  • It is not in this instance since url() should have a quoted argument any way. In the circumstance though that I need to have something unquoted I would still like to know how to properly escape the default parameter. The main problem is that $path is not expanding =/ – Tegra Detra Mar 17 '14 at 18:19
  • possible duplicate of [sass background mixins using url](http://stackoverflow.com/questions/17854975/sass-background-mixins-using-url) – Tegra Detra Mar 17 '14 at 18:28

0 Answers0