SASS Stops Compiling at Comment?

2 views
Skip to first unread message

Karl

unread,
Oct 14, 2009, 7:29:32 PM10/14/09
to Compass
Consider:

#category-list
:margin-bottom 2em
.catalog-description
:float right
:border-right 4px solid #ddd
// :padding 1em
table
:text-align inherit
:font-size .8em
:margin-bottom 0
th, td, caption
:padding 0px 8px 0px 0px
.column-separator
:border-right 4px solid #ddd
:background none

One line is commented out, thus produces:

#category-list { margin-bottom: 2em; }
#category-list .catalog-description { float: right; border-right: 4px
solid #ddd; }

Uncomment the line:

#category-list { margin-bottom: 2em; }
#category-list .catalog-description { float: right; border-right: 4px
solid #ddd; padding: 1em; }
#category-list .catalog-description table { text-align: inherit; font-
size: .8em; margin-bottom: 0; }
#category-list .catalog-description table th, #category-list .catalog-
description table td, #category-list .catalog-description table
caption { padding: 0px 8px 0px 0px; }
#category-list .catalog-description table .column-separator { border-
right: 4px solid #ddd; background: none; }

Is SASS (or Compass) supposed to stop compiling a branch when it
encounters a comment? or is there something wrong with my SASS?

Chris Eppstein

unread,
Oct 14, 2009, 7:35:52 PM10/14/09
to compas...@googlegroups.com
Comments, like most things in sass, affect what is indented below them. If you start your comment next to the :padding style instead of at the start of the line, you'll have your desired effect.

chris

Charles Roper

unread,
Oct 21, 2009, 12:03:54 PM10/21/09
to compas...@googlegroups.com
Karl,

What editor are you using? If you're on Textmate or E Text Editor (or
one of the other editors that support Textmate grammars), the syntax
highlighting should show up what is commented and what is not.

Example: http://i.imgur.com/oIGj2.png

And with Chris's suggested fix: http://imgur.com/CKa1D.png

If you have one of these editors and you're still having problems, you
may have an older copy of the Sass bundle which had problems,
particularly with comments. I've merged in some changes and done some
work lately to fix these problems:

http://github.com/charlesr/ruby-sass-tmbundle

Hope that helps.

Charles

Karl

unread,
Oct 27, 2009, 6:31:54 PM10/27/09
to Compass
Charles,
I think the main issue was that I was not expecting sass to behave
like this. Not that it is wrong, just unexpected.

In addition, I use TextMate, and am accustomed to clicking anywhere in
a line and typing cmd-/ to comment out the line. In ruby, it pretty
much doesn't matter where the # is on the line, the entire statement
on that line after the * becomes a comment.

Thanks for the education.
Reply all
Reply to author
Forward
0 new messages