set the imagebasepath for local css files

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
6/22/2011 3:24:32 PM
Gravatar
Total Posts 76

set the imagebasepath for local css files

Is there a way to set the imagebasepath for local css files?

<cssfiles>

<file imagebasevpath="/StaticDir/" >style.css</file>

</cssfiles>

It seems to ignore it and puts the skin path... :(

.feed {
    background: url("/Data/Sites/1/skins/MySkin_V2/images/rss_14.png");

I would love of the css combiner to spit out.

.feed {
    background: url("/StaticDir/images/rss_14.png");

I would like not force users to download static images when i update to new skin versions by needing the images to travel with the skin.

Thanks for the help

 

6/23/2011 12:42:15 PM
Gravatar
Total Posts 18439

Re: set the imagebasepath for local css files

CSS expects the images to have paths relative to the CSS file itself and this assumption is also expected by our CSSHandler that combines the CSS and resolves the urls back to the root of the site.

If you want to store images in /static and use them in CSS then you should put your CSS file also in the /static folder

<file cssvpath="/static/style.css" imagebasevpath="/static/">none</file>

In order for our CSSHandler to correctly combine things and resolve the urls, you must also make sure when you set background images in CSS to use single quotes around them like this:

.myclass  {background: url('images/myimage.png'); }

note that this example would have the images in a sub folder below the folder with the CSS file named images, if its in the same folder as the CSS it would be:

.myclass  {background: url('myimage.png'); }

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.