NYCPHP Meetup

NYPHP.org

[nycphp-talk] CSS Variables

Damion Hankejh (ingk) d at ingk.com
Wed Jun 18 11:05:13 EDT 2008


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.

-----

To gain the benefits of browser/proxy caching, trimmed down page size(s) and
thus faster loading pages, CSS should be in its own file.  Just link to the
file in the header of your view files using:
<link rel='stylesheet' href='http://domain.com/css/gui.css'>

However, if you want to keep stylesheets in your Smarty template, place it
within {literal} ... {/literal} tags to force Smarty to ignore everything
therein, including brackets.  JavaScript can also safely be left unparsed by
Smarty in this way.






More information about the talk mailing list