-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relative @imports within isolated engine not found #137
Comments
I'm pretty sure this is intendet behavior with the folder structure you have. You can read about Sprockets |
Using Sprockets directly I can easily load the relative file using
But then I lose all the inherited goodness
|
|
I take it this project is responsible for supplying the load paths then? From: http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import
|
I've opened a similar issue on the SASS project: sass/sass#672 We'll see what they say. |
The guys at SASS say this is a sass-rails issue and that SASS by default will always search relative to the current file first. |
Right. @guilleiguaran thoughts? |
This appears to have been fixed at some point. The bug is not present in the current gem, but still there in the latest release for Rails 3. Would be awesome if a version with the fix could be released for rails3, as this bug makes it very hard to provide x-platform Sass code (see twbs/bootstrap-sass#523). |
@glebm I did some investigation about this here: https://github.com/radar/rafael/pull/1 I uses bootstrap-sass as example of right usage of the import path but seems it is changed now. TL;DR, a workaround is always use absolute path if you want to make possible users to override. The propex fix is change sass-rails/sass to put the current folder at the end of the load path. I could not work on this yet, sorry. |
@rafaelfranca Sass is probably not it because I'm using the same sass in Rails 4 and it just works. Nothing relevant seems to have changed in sass-rails between versions either. Absolute path workaround breaks it for bower, composer, and standalone sass. |
Looks like sprockets no longer modifies Sass path resolution since this commit 2 years ago, which may be why this works in Rails 4. sstephenson/sprockets@d9ba0d4 |
bootstrap-sass now uses relative paths that resolve both from load_path and from the file's location for older sprockets compatibility. |
In 2e1ca4e, all imports in _bootstrap.scss were namespaced to support older Rails/Sprockets (see rails/sass-rails#137 (comment)). Unfortunately, this wasn't also applied to the mixins sub-directory, causing failures like twbs#806. See twbs#806 (comment)
Given an engine like the following
And the corresponding namespaced folder structure
Relative imports within the engine don't appear to be working. For example:
Sass appears to be checking relative to the host file instead of relative to
application.css.scss
itself. Is this the intended behavior? I always thought@import
was relative to the current file.Just want to make sure I'm not doing something stupid. Feels dirty having to namespace the relative requires within the engine itself.
The text was updated successfully, but these errors were encountered: