tags:

views:

214

answers:

1
=rounded(!rad)
  :-moz-border-radius = !rad
  :-webkit-border-radius = !rad
  :border-radius = !rad

I have this mixin defined in a .sass file. When I try to compile it with sass style.sass style2.css, I get this error:

Syntax error on line 2: Undefined constant: "!rad".

I've looked through the docs and can't find what I am doing wrong. If I reduce the sass file to just this section, the error still happens. I am not using it with Ruby/

+1  A: 

That mixin looks absolutely correct to me. Is that in style.sass or style2.sass? I'm guessing you're defining it in one, and using it in the other.The first thing to check would be that when you're mixing it in, you're not forgetting to pass an argument. For instance:

.round_div
  +round // will not work

Instead of

.round_div
  +round(1em) // should work

If that's not the case, try updating Sass. The ability to pass arguments to mixins was added in 2.2.0.

I've got a gist a put up a few days ago for a slightly more complex version of the same mixin. It's working fine for me as long as I mix it in with an argument, and have a new enough version of Sass.

Emily
Ah... my Sass version is 2.0.9 (from the Ubuntu repos)
Macha