Skip to content
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 paths base in Sprockets directives #241

Closed
glebm opened this issue Aug 23, 2014 · 2 comments
Closed

Relative paths base in Sprockets directives #241

glebm opened this issue Aug 23, 2014 · 2 comments

Comments

@glebm
Copy link

glebm commented Aug 23, 2014

Sprockets directives in a partial are not processed relative to that partial.

E.g., if _glyphicons.scss partial begins with:

//= depend_on "../../fonts/bootstrap/glyphicons-halflings-regular.eot"

However, this does not work: Sprockets::DirectiveProcessor runs with app/assets/application.scss, instead of the partial where the directive appears.

Does this seem like a bug? Is there a way to depend_on a file using relative path?

My initial thought was to add a pre-processor replacing all the relative depends_on(-asset) paths in partials. Unfortunately, Sprockets directive processing API is not public.

Background: I would like bootstrap-sass to work on Rails 4.1 without altering load path (useful when one uses a Bower package and not the gem). Everything works except this depend_on raises a FileNotFound exception. Update: Resolved in sprockets-rails 2.1.4, by no longer requiring depend_on in this case.

@yordis
Copy link

yordis commented Aug 27, 2014

@rafaelfranca any help with this one?

@rafaelfranca
Copy link
Member

For what I remember sass-rails (or sass) doesn't work well with relative paths. Unfortunately I don't have time to investigate this issue so I recommend you to try to understand what is going on

rroblak pushed a commit to insight-meditation-center/imc-bootstrap-sass that referenced this issue Nov 9, 2015
kyouko-taiga pushed a commit to umiushi/umiushi that referenced this issue Feb 28, 2017
This reverts commit 2eb5fafeb7608e2ceadd215b3924f60aa3d83230.
See rails/sass-rails#241
bluedone added a commit to bluedone/bootstrap-rubygem that referenced this issue Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants