SASS import whole directory?

2,605 views
Skip to first unread message

Eumir

unread,
Jan 23, 2011, 11:49:47 PM1/23/11
to Sass
just checked in SO for a whole import directory function and my
thoughts were confirmed that it isn't.

http://stackoverflow.com/questions/4778627/is-it-possible-to-import-a-whole-directory-in-sass-using-import

Will this be included in a future build? :) I surely hope so as I'm
pretty sure I'm not the only one who imports files like this.

Brandon Mathis

unread,
Jan 24, 2011, 1:47:34 AM1/24/11
to sass...@googlegroups.com
Sorry, but this is not a feature that will likely ever be built.

Given the cascading nature of CSS, determining the correct import order for Sass files is a problem. If you automatically import all files in a directory you have no way to control which files go first. Thus it becomes impossible to confidently override Sass written in another file.

Even if there were some kind of guideline (like alphabetical order) you'll have to resort to unconventional naming rules, which isn't very discoverable.

It seems like a nice feature and many have suggested it, but there are too many oddities for it to be practical, and in the end only saves you from typing out filenames but then creates complexities in places where there were none before.

- Brandon Mathis

> --
> You received this message because you are subscribed to the Google Groups "Sass" group.
> To post to this group, send email to sass...@googlegroups.com.
> To unsubscribe from this group, send email to sass-lang+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sass-lang?hl=en.
>

Eumir Gaspar

unread,
Jan 24, 2011, 1:58:44 AM1/24/11
to sass...@googlegroups.com
I see, I never thought about it in that perspective. Well if you need to override that "feature" you could always go back to importing it on the order you want right? I mean not all devs actually make styles that depend on each other (in a way that declaring them needs a specific order). 

In any case, it was just a suggestion and you do present a very valid point. 
Reply all
Reply to author
Forward
0 new messages