[Catalyst] correct way to call CSS files?
Alan Humphrey
alan.humphrey at comcast.net
Thu Apr 21 23:26:56 CEST 2005
Something's not quite right. My .css file appears to be getting served,
but it isn't being interpreted by my browser. If I copy the generated
webpage and the css file to another location and load them from there
(by passing Catalyst) all is well. Here's what I've got:
In my Mason Autohandler (in the head section)
<style type="text/css">
@import "/css/birdweb.css";
</style>
In the application class of my app:
sub css : Regex(^.*\.css$) {
my ( $self, $c ) = @_;
$c->serve_static;
}
when I load a page I see this in the log:
[Thu Apr 21 14:14:21 2005] [catalyst] [debug]
**********************************
[Thu Apr 21 14:14:21 2005] [catalyst] [debug] * Request 22 (0.001/s)
[2013]
[Thu Apr 21 14:14:21 2005] [catalyst] [debug]
**********************************
[Thu Apr 21 14:14:21 2005] [catalyst] [debug] Requested action is
"css/birdweb.css" and matched "^.*\.css$"
[Thu Apr 21 14:14:21 2005] [catalyst] [debug] Snippets are "1"
[Thu Apr 21 14:14:21 2005] [catalyst] [debug] "GET" request for
"css/birdweb.css" from localhost(127.0.0.1)
[Thu Apr 21 14:14:22 2005] [catalyst] [debug] Serving file
"/home/alanh/birdweb/trunk/BirdWeb-Admin/root/css/birdweb.css" as
"text/plain"
[Thu Apr 21 14:14:22 2005] [catalyst] [info] Request took 0.119349s
(8.379/s)
.=-----------------------------------------------------------------+----
------=.
| Action |
Time |
|=-----------------------------------------------------------------+----
------=|
| /css |
0.108839s |
'=-----------------------------------------------------------------+----
------='
It appears that the file is being served.
I'm running the script/server.pl server, if that might matter.
Any ideas?
- Alan
More information about the Catalyst
mailing list