andrewdavey / knapsack

Project moved to https://github.com/andrewdavey/cassette
MIT License
24 stars 3 forks source link

Images in stylesheets #4

Closed jochenjonc closed 13 years ago

jochenjonc commented 13 years ago

In stylesheets you can have the following:

div#header { background: #325b89 url(images/header-background.png) repeat-x top; }

The images folder is a relative path starting from the stylesheet itself. But when the stylesheet is minified and combined and called via /knapsack.axd, the relative path isn't correct anymore. Because the image is now search on the following path:

/knapsack.axd/styles/Content/images/header-background.png

A nice feature for knapsack would be that the knapsack.axd returns the image.

andrewdavey commented 13 years ago

Thanks for reporting this issue.

Another options is to rewrite the image URL in the CSS to be absolute. Thoughts?

jochenjonc commented 13 years ago

For my custom css that is indeed an option, but for the css that came with jQuery UI it is more difficult. Especially when a new theme is rendered via ThemeRoller.

In the end it makes integrating Knapsack a lot easier.

andrewdavey commented 13 years ago

Sorry, I meant to say, have Knapsack rewrite the URL to be absolute when it creates the module.

andrewdavey commented 13 years ago

I've pushed css url rewriting to master. Can you give it a quick test and let me know if it's working for you. If everything is good I'll make a new nuget package.

jochenjonc commented 13 years ago

Time to make the nuget package, this thing rocks.