NYCPHP Meetup

NYPHP.org

[nycphp-talk] CSS Variables

tedd tedd at sperling.com
Wed Jun 18 12:09:50 EDT 2008


At 10:47 AM -0400 6/18/08, Justin Dearing wrote:
>On Wed, Jun 18, 2008 at 9:52 AM, tedd <tedd at sperling.com> wrote:
>>  Or this:
>>
>  > http://sperling.com/examples/pcss/
>
>You know I was using smarty templates for CSS but I think I like this
>better for the following reasons:
>
>1) I had to escape the {} brackets that weren't variables, or change
>the variable delimeter in smarty.
>2) This just works and does what I need for CSS. The whole smarty MVC
>thing is overkill, expecially when my view (the css) isn't a view.


Glad to be of service.

If you will consider using a .htaccess doc, then try this:

<FilesMatch ".*\.css">
	ForceType application/x-httpd-php
</FilesMatch>

That way you won't have to rename the suffix of your css files to 
php. However, you'll still need to have your css files start with --

<?php header('Content-Type: text/css; charset=UTF-8'); ?>

-- for browser like FireFox, which actually does this right. Most 
other browsers don't require a header.

Cheers,

tedd



-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com



More information about the talk mailing list