views:

119

answers:

2

I have previously made a mixin in sass 2.2.22 for my font sizes(it's a font converter), like so:

=6.5pts
  :font
    :size 9px

It has been working ever since i first made it a year ago. We just upgraded to haml/sass 3 and now whenever I try to refresh the page im working on, a sass compile error appears like so:

http://grab.by/4yFE

I don't get it since Sass 3 documentation says that the = declaration for mixins is NOT deprecated. I tried uninstalling haml 3.0, restarted my server and deleted the generated css file and now it apparently works. Problem is, I need haml 3 for another related project where we just started using Compass.

Why is the compiler complaining when the documentation claims the declaration is not deprecated?

A: 

you probably need to put it like this:

=6.5pts
  font:
    size: 9px

see a perfect example in the reference: http://sass-lang.com/docs/yardoc/file.INDENTED_SYNTAX.html#mixin_directives

barraponto
the prepended colon also works for sass and it wasn't deprecated in sass 3, right?
corroded
i didn't know about it, but since it is not in the documentation, it might have been deprecated. lemme check.
barraponto
+2  A: 

Does SASS-latest continue permit mixin names a) beginning with a numeral and b) containing a period?

From the SASS docs, "SassScript variable and mixin names may now contain hyphens. In fact, they may be any valid CSS3 identifier." This tells me that text which does not constitute a valid CSS3 identifier may not constitute a valid SASS variable or mixin name.

From the CSS docs, "In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A1 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, or a hyphen followed by a digit." Note that the period has Unicode codepoint U+002E.

If SASS-earlier let you get away with variable and mixin names either beginning with a numeral or containing a period, then this behavior might never have been intended and might now have been dropped from support.

Something to look into.

Justice
hmm yeah that could be something to look into although that means im in for a refactoring of code. I have thought of this but was denying it to myself (partly because i don't want to refactor) but then it looks like the only way to fix this problem. I'll try commenting it out tomorrow and see where it gets me
corroded