Get stylesheet

Permalink
Hey,

just wondering if anyone else is having this problem, i use the code

getStyleSheet('your_stylesheet.css')?>

to get a style sheet in a theme,

if the style sheet has images in the CSS they are not parsed correctly. if i use getThemePath they work,

code:
url('images/something.png')

when i look at the source its

url('http://site.com/index.php/tools/css/theme/'images/something.png'')

they 2 ' are not being stripped so no images show.

Anyone else? (SVN build from a few weeks ago)

Mnkras
View Replies: View Best Answer
Filofox replied on at Permalink Reply
Late reply, but for future reference: URLs in CSS stylesheets are relative to the stylesheet file itself. So if the stylesheet is in the theme folder, unless you use a URL relative to the root folder -- e.g. url(/img/image.png) -- then the image's path will be generated relative to the style sheet's own path.
Mnkras replied on at Permalink Reply
Mnkras
yea i know that, but getthemepath(); works fine, getstylesheet adds 2 extra ' around the path specified in the CSS files breaking the paths
Arismoon replied on at Permalink Reply
Arismoon
Any resolution to this? I was exploring the customize options for css and switched to the getStyleSheet function and am having the same problem.
sebastienj replied on at Permalink Reply
sebastienj
I had this problem. If I remember correctly, I had to put the full url in CSS (with http).
I'm not at my computer, I can not verify what I say. But there was a solution.
smartwebprojects replied on at Permalink Best Answer Reply
smartwebprojects
I faced with this issue too. I simply don't use apostrophes in css and it works :-)

I.e.

Instead of

.someclass {
background: url('somefile.jpg');
}

I use

.someclass {
background: url(somefile.jpg);
}