0

Each bit of my project is a separate component, with its own hierarchy. To include them in my file, I just need to include the app.jsand inject it to whatever I want. So for each component, I have a separate config.rb file to run the compass for it.

Now, say I have the following hierarchy:

/app
    config.rb
    /assets
        /sass
            _functions.scss
        /css
    /components
        /login
            /assets
                /sass
                    app.scss
                /css
            config.rb

Say I want to @import _functions.scss into app.scss. Right now, I have to use the relative path , and basically keep on going back the root folder, and then go into the folder for the file.

Is there a way to define the path inside the login's config.rb file?

Kousha
  • 32,871
  • 51
  • 172
  • 296
  • Possible duplicate: http://stackoverflow.com/questions/15949004/sass-or-less-packaging – cimmanon Jun 04 '14 at 00:14
  • Not really what I asked? That is for creating extensions, I am not creating extensions. I just want to define a variable and use to @import other files – Kousha Jun 04 '14 at 05:23

1 Answers1

0

You can uses the add_import_path directive in your config.rbfile, like I do in a project to access vendors mixins:

add_import_path "#{File.expand_path(sass_dir)}/vendors";

In your case, it would be:

add_import_path "#{File.expand_path('./assets/sass')}";
piouPiouM
  • 4,937
  • 1
  • 21
  • 22