This is my usual practice: Mixins and constants go in _base.sass, that gets imported in every stylesheet. Screen.sass is where all my application-wide rules go; usually I do [controllername].sass for any section-specific rules. If the rules I'm making are pithy and small, I don't bother with the extra file and just stick it in the screen.sass as it's an unnecessary HTTP request.
It's not really every page that needs a new Sass file. In fact a nice cascade is probably more powerful in terms of reducing your work than the complexity involved in managing a large number of page/controller- specific sass files. -Lorin On Jul 15, 2009, at 10:41 PM, Chris Eppstein wrote: > I don't see a lot of harm in letting the user load 1 medium sized > stylesheet that will be cached and never fetched again for their > browsing session. That is probably a better experience for them than > having to fetch an optimized stylesheet for every page. > > That said, sass has an @import mechanism that will let you bring in > other sass files. If those files have style rules, they will become > part of the stylesheet at the point where the @import was declared, > the mixins in that imported stylesheet will also be available to you. > > The syntax is: > > @import foo.sass > > if foo.sass is named _foo.sass it will be imported, but no > corresponding css file will be generated for it. > > The import can be relative to the current sass file or relative to > any entry in the sass load path. > > I would also point you to the compass project where there are > hundred of mixins that you can use, already implemented and battle > tested. > > http://compass-style.org/ > > chris > > On Wed, Jul 15, 2009 at 8:38 AM, José Mota <[email protected]> > wrote: > > Hello guys! First of all a big up to Hampton and Nathan for such a > wonder of modern web, great stuff in here! > > I'm designing a Rails app in which I intend to use more than one > stylesheet because I just don't need all of the rules on every > pageview. > > Since Sass' idea is a DRY one, I wonder how am I able to access my > mixins and variables from a single .sass file (idk?) and then every > separate .sass file could use the stuff? things like roundedcorners > and such… perhaps some file loaded from the app boot? > > Thanks for the help! > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
