In this issue I note that there may be a typo in the README file. It may be I'm tripping over that issue (if there is one) when I try to figure out how to do other things with zen. Meanwhile, the documentation there seems to be written with the assumption that we want to load all our css on all pages of the site. In my case, I want a front.css that only gets incorporated into the aggregated css for the homepage. I don't want every page on the site to have to load css that applies only to a layout that is unique to the homepage. Using an @import declaration in styles.scss would have the effect of loading the css on all pages of the site.

In my front.scss, I do want to take advantage of sass features such as variables, so I do want a front.scss and a front.css that gets overwritten by compass whenever I make a change to front.scss. How can I accomplish this without importing front.css in all pages of the site? (You can assume I'm familiar with the ordinary Drupal approaches for adding css to a particular page.)

Thank you

Comments

arnoldbird’s picture

Looks like I need to use the compile command for this. From my theme directory...

compass compile sass/front.scss

Though I'm not quite there, because variables set in _init.scss are not available in front.scss. I get "undefined variable" errors.

arnoldbird’s picture

The "undefined variable" error is resolved by importing _init.scss in my front.scss:

@import "init";

Though perhaps it would be more appropriate to name my file _front.scss with an underscore.

arnoldbird’s picture

Though perhaps it would be more appropriate to name my file _front.scss with an underscore.

No, I think it needs to be named without an underscore since it isn't referenced in styles.scss. Otherwise compass won't notice changes to the file.

arnoldbird’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.