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

How to package stylesheets with local images? #7

Open
tschofen opened this issue Nov 22, 2009 · 4 comments
Open

How to package stylesheets with local images? #7

tschofen opened this issue Nov 22, 2009 · 4 comments

Comments

@tschofen
Copy link

I'm using jquery plugins. Each is a separate folder in my javascript directory. These folders contain css files and images that are referred to from the css files.
When asset_packager combined these files the path to the images is not adapted to find the images in their original folder. An example:
Part of my .yml file:

  • ../javascripts/tools/styles

Given the following files
javascript/tools/styles.css => in this file a reference to url(tooltip.png) refers to the following file:
javascript/tools/tooltip.png

After packaging the image reference hasn't changed and the image can't be found.

Can this be accomplished?

Thanks

@wkrsz
Copy link

wkrsz commented Dec 18, 2010

asset_packager would have to scan for relative patchs and replace them with absolute ones. Can be implemented, but definitely not trivial. And I suspect the solution would be error-prone.

@PhilT
Copy link

PhilT commented Apr 21, 2011

The Jammit packager can do this although it uses the YUI compressor and requires Java which I don't like.

@bzitzow
Copy link

bzitzow commented Nov 21, 2014

Bump.

Font location:
bower_components/font-awesome/fonts/custom-font-here.woff

non-compiled css location:
bower_components/font-awesome/css/font-awesome.css

font reference path (in font-awesome.css):
../fonts/custom-font-here.woff

Compiled CSS stored in public/stylesheets/bower_components.css is reference ../fonts/custom-font-here.woff - 404 not found.

@sbecker
Copy link
Owner

sbecker commented Nov 21, 2014

Hi @bzitzow - Asset Packager is no longer being actively maintained. It was written in the Rails 1.X days. If you need to continue using it, I would suggest writing an additional rake task that copies your fonts to the path the compiled css expects it, which looks most likely to be: public/fonts/custom-font-here.woff

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

5 participants