Import from command line

49 views
Skip to first unread message

Alexander Samilyak

unread,
Apr 15, 2013, 11:56:26 AM4/15/13
to sass...@googlegroups.com
Is there stylus --import <file> command line option analogue for sass command line process?
Or plans/ticket to add such an option.

Nathan Weizenbaum

unread,
Apr 16, 2013, 3:23:05 PM4/16/13
to sass-lang
What's the utility of such an option? Why not just write the @import in your stylesheet? It seems wrong to have a stylesheet that only works if you pass certain command-line parameters.


On Mon, Apr 15, 2013 at 8:56 AM, Alexander Samilyak <aleks...@gmail.com> wrote:
Is there stylus --import <file> command line option analogue for sass command line process?
Or plans/ticket to add such an option.

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

Hampton

unread,
Apr 16, 2013, 3:52:42 PM4/16/13
to sass...@googlegroups.com
I guess its useful if you want to dynamically script what gets imported? Aka, in a load process or something?

Chris Eppstein

unread,
Apr 16, 2013, 4:10:01 PM4/16/13
to sass...@googlegroups.com
If you're generating sass, why not generate the @import too?

Alexander Samilyak

unread,
Apr 16, 2013, 5:28:16 PM4/16/13
to sass...@googlegroups.com
The reason I ask about command line import is the following.
I have a collection of mixins/functions/placeholder selectors and it's global for my project. And I don't really like import it in every sass module I have (module is a page here, it may contain several .scss files).

So if I would have import command line option then I used it in my build script and pass fixed "path/to/global.scss" there.
It's like a --require option but for sass code rather than Ruby code.

Yes, I can generate that @import and use --stdin option. But it's kinda quick and dirty, don't you think?

Alexander Samilyak

unread,
Apr 19, 2013, 11:58:46 AM4/19/13
to sass...@googlegroups.com
Hello guys... Any suggestions?

Hampton

unread,
Apr 19, 2013, 12:17:05 PM4/19/13
to sass...@googlegroups.com
It's probably not something we can get out fast. We'd definitely consider a patch! But, for now I'd suggest a short term solution... Sed can work wonders!

We might also consider something like this in sassc

Nathan Weizenbaum

unread,
Apr 19, 2013, 2:01:22 PM4/19/13
to sass-lang
I wouldn't want to add this functionality. I want to limit the number of ways there are to create a Sass file that only works in your environment and not anyone else's, and I also want to move towards a world where what you're importing is more explicit, not less so.

Chris Eppstein

unread,
Apr 19, 2013, 6:14:04 PM4/19/13
to sass...@googlegroups.com
Consider this? What is the time savings of not explicitly having @import "path/to/global.scss" in every file in comparison to the the time cost of people not knowing what files are going to imported into their stylesheet and the extra debugging costs this will entail. it's really a very trivial thing to do and having done it you've made your stylesheets more maintainable.

What's more, if you're compiling many stylesheets and you finally have a single stylesheet where you _don't_ want to import that, now you have to add it to all your existing stylesheets just so you can have the one exception.

Aside: Not even compass auto-imports the compass libraries into stylesheets and no one really complains about this.

Chris
Reply all
Reply to author
Forward
0 new messages