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

Incorrect relative URL in css #478

Closed
chuchiperriman opened this issue Nov 12, 2021 · 3 comments · Fixed by #482
Closed

Incorrect relative URL in css #478

chuchiperriman opened this issue Nov 12, 2021 · 3 comments · Fixed by #482

Comments

@chuchiperriman
Copy link

We have updated sprockets-rails to 3.3.0 and now relative urls are wrong. With his line in css:

src: url(./fontawesome/fa-brands-400.eot);

the url is transformed to:

src: url(/./fontawesome/fa-brands-400.eot);

The first slash is incorrect because we have the font files in a path relative to the css, not in the root

@tvdeyen
Copy link

tvdeyen commented Nov 15, 2021

Happening for us as well. The weird thing is that for us it is the other way round. Without ./ the url is considered absolute instead of relative. Changing it to ./ helped. I assume it is because you are not using quotes, while we are.

See AlchemyCMS/alchemy_cms@c6e3cf2

tvdeyen referenced this issue Nov 15, 2021
* Process css files so that they get digested paths for asset files

This is required so that we can use cssbundling-rails and reference images that will receive digested paths

* Style

* $1 is calculated before calling #gsub

Co-authored-by: David Heinemeier Hansson <[email protected]>
@rafaelfranca
Copy link
Member

The new url processor will change relative paths to absolute paths, but at least the absolute paths should be correct. @jcoyne can you take a look?

@jcoyne
Copy link
Contributor

jcoyne commented Nov 19, 2021

Yes, I'll have a look.

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

Successfully merging a pull request may close this issue.

4 participants