I'm glad you're enjoying Sass, and it's cool to see an alternative
implementation being worked on. The most up-to-date implementation is
at http://github.com/nex3/haml, so check that out.
Issues 1, 3, and 4 are due to Sass not attempting to fully parse CSS
selectors. At some point enough processing will be done to handle the
cases you brought up, so you can safely implement your expected
behavior there.
> ### 2 ###
> Color shortcuts in string literals can be a bit of a surprise
>
> p
> :foobar = i have a red bicycle
> ---
> p { foobar: i have a #ff0000 bicyble }
Implicit strings have been deprecated. SassScript now requires all
strings to have quotes around them (unquoted strings will work, but
throw deprecation errors). This is in part to get rid of confusing
cases like this one.
Both examples are expected. The second example recognizes a "div, foo"
selector nested beneath "p", but there's no content nested beneath
that. The "color" property is just nested beneath "p". Since Sass
doesn't output empty selectors, it's behaving as expected.
The third example throws an error because selectors that are continued
following a comma must have future lines at the same indentation level
as the original. Sass sees the example as nesting ".foo" beneath
"div,", and throws an error since "div," is an invalid rule.
> ### 6 ###
> This isn't such a big deal but the docs and source code could be a bit
> more precise with their use of CSS terminology. Specifically, what is
> extensively referred to as an 'attribute' is actually called a
> 'declaration' in CSS. 'Attributes' in the context of CSS most often
> refers to a certain category of selectors (e.g. div[title="foo"]).
> Similarly, what is referred to as "attribute namespaces" should be
> called "property namespaces." Lastly, what is referred to as "rule
> escaping" in the Sass documentation ought to be called "selector
> escaping."
This is something we should fix. Thanks for bringing it to our attention.
> ### 7 ###
> Developers can get away with pretty bizarre constant identifiers and
> length/unit suffixes. This also isn't such a big deal, but lexing
> could be a bit more efficient/simpler if things were locked down some
> more. (Perhaps adopt Ruby's rules for identifiers?) As an example,
> this is a legal statement in Sass:
> ![]@~.......FOO = 2
> It creates a constant with name "![]@~.......FOO" and assigns the
> value 2 to it.
For Sass 2.2, variable names will be restricted to Ruby's allowable
symbol names; that is, symbols matching [a-zA-Z_][a-zA-Z0-9_]*.
Sensible support for international text will need to be added at some
point.
> ### 8 ###
> There are many more built-in color shortcuts in CSS (as implemented in
> the major browsers) than those mapped in Sass. Sass does get all the
> W3C specified ones though. See http://www.w3schools.com/css/css_colornames.asp
> Papaya Whip!
I think we're going to stick with the W3C here.
> ### 9 ###
> The adjacency operator (concatenation) requires a space between
> arguments, unlike Ruby which doesn't always require a space. If
> you're going for the Ruby idiom, you probably shouldn't require a
> space.
This is in SassScript? I don't believe Ruby has a similar
concatenation operator... in any case, the parsing of SassScript has
been completely overhauled for Sass 2.2 and now does not require
whitespace where it's not necessary to distinguish separate tokens.
Huh, so it does. I could have sworn it didn't when I tested it before.
In any case, the space isn't required in 2.2.
> Rhett,
> I actually wrote something very similar to what you linked at my job
> (JRuby + Haml/Sass gem + J2EE filters and servlets). It's working ok,
> but takes about 5 to 10 seconds to compile some of our large Sass code
> bases to CSS, which can be annoying for development (it caches the
> output, so it's not a concern for production). Have you had similar
> performance issues? I think the source of the slow down in my case
> was JRuby + JVM 1.4. Performance is quite a bit better on JVM 1.6,
> but a lot of our products are still running 1.4. I've been using
> CRuby privately to speed things up at development time for myself, but
> would like to keep everything in the Java stack if possible, hence my
> project...
After 2.2 is out, we're going to start working on improving
performance significantly.