Hey Nathan,

This is a really awesome feature.  However, I think I've found a bug
with
the compile behavior, where files are not always regenerated.

Let's say you have parent.sass and child.sass, where parent @imports
child.

If you make a change to child.sass, save it, then reload your page in
the browser, parent.sass will not be recompiled because it has not
changed, even though it @imports content that has changed!


On Mar 25, 6:00 am, Nathan Weizenbaum <[EMAIL PROTECTED]> wrote:
> Hello, fellow Hamlites,
>
> While it's nice to be able to create standalone Sass templates, each
> website usually has at least three or four CSS files. Sass is wonderful
> for reducing the amount of repetition within a document, but what does
> it offer to minimize repeated code between several files? Is there a way
> to have all the CSS files share a few core rules or even (dare I
> suggest!) constant definitions?
>
> Well, until now, there wasn't. But why would I have brought those issues
> up, in a Sneak Peek no less, if I weren't going to show a solution?
> Well, here's that solution: "@import". You may recognize that from CSS.
> Indeed, in Sass it works much the same way. It imports both the rules
> and the constants from another Sass file into the current file. So, for
> example, if you had a Sass file with a constant definitions and a small
> rule:
>
>   // shared.sass
>   !color = #1356e3
>
>   a img
>     :border-style none
>
> You couldimportit into another file
>
>   // main.sass
>   @importshared
>
>   #navbar
>     :background-color = !color
>
> And this would compile to
>
>   a img {
>     border-style: none; }
>
>   #navbar {
>     background-color: #1256e3; }
>
> You may notice that I included just "shared", leaving off the ".sass"
> file extension. This is acceptable, as is explicitly including
> "shared.sass". If the file extension is removed and no file called
> "shared.sass" is found, theimportdirective will just compile to a
> literal CSS "@importshared.css". This makes it easy to transition from
> CSS to Sass without having to change the imports whenever you switch
> over a template.
>
> As always, this feature is available right now in the Haml trunk, which
> can be installed using "./script/plugin 
> installhttp://svn.hamptoncatlin.com/haml/trunk"; for Rails or "svn co
> svn://hamptoncatlin.com/haml/trunk" standalone. Give it a try.
>
> Enjoy!
> - Nathan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to